-
Notifications
You must be signed in to change notification settings - Fork 1
concept base_quantity_exponent
kwikius edited this page Jun 25, 2020
·
35 revisions
a base_quantity raised to a non-zero rational power
type | model of | notes |
---|---|---|
E | base_quantity_exponent | |
E1, E2 | base_quantity_exponent | |
Eres | base_quantity exponent | local result |
B | base_quantity | |
R | rational | |
D | dimension |
value | type | notes |
---|---|---|
e1 | E1 | |
e2 | E2 | |
eres | Eres | |
n | integral_constant | |
d | integral_constant |
static_constant | value | notes |
---|---|---|
is_base_quantity_exponent<E> | true |
type_expression | result | notes |
---|---|---|
get_base_quantity<E> | B | B is the base_quantity for E |
get_exponent<E> | R | R is the exponent of E. R is never equal to ratio<0>{} |
concept | notes |
---|---|
dimension<E> | a base_quantity_exponent is implicitly a model of dimension |
static_constant | value | notes |
---|---|---|
of_same_base_quantity< E1, E2 > | true if E1,E2 have same base quantity else false |
expression | requires | result | notes |
---|---|---|---|
e1 * e2 | of_same_base_quantity<E1,E2> | let ra = get_exponent<E1>{}; let rb = get_exponent<E2>{}; ((ra + rb) == ratio<0>{}) ? dimensionless : eres |
adds the exponents of e1 and e2 |
e1 * e2 | not of_same_base_quantity<E1,E2> | dimension_list<E1,E2>{} | |
e1 / e2 | of_same_base_quantity<E1,E2> | let ra = get_exponent<E1>{}; let rb = get_exponent<E2>{}; ((ra - rb) == ratio<0>{}) ? dimensionless : eres |
subtracts the exponents of e1 and e2 |
e1 / e2 | not of_same_base_quantity<E1,E2> | dimension_list<E1,decltype(dimensionless{}/e2)>{} | |
pow<n,d>(e) | let r = get_exponent<E>{}; ((r * ratio<n,d>{}) == ratio<0>{}) ? dimensionless : eres |
multiplies the exponent of e by ratio<n,d>{} |