Skip to content

concept base_quantity_exponent

Andy Little edited this page Jul 8, 2020 · 35 revisions

| Home | Concepts | TypeTemplates | Types | TypeFunctions | InlineConstants |

Description

a base_quantity raised to a non-zero rational power

Notation

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 int
d int

Requires

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>{}

Provides

concept notes
dimension<E> a model of base_quantity_exponent is implicitly a model of dimension
static_constant value notes
of_same_base_quantity< E1, E2 > true if E1,E2 are exponents of same base quantity
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> sort(dimension_list<E1,E2>{}) sort using total ordering of base_quantities
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> let e2_inv = dimensionless{}/e2;
sort(dimension_list<E1,decltype(e2_inv)>{})
sort using total ordering of base_quantities
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>{}
Clone this wiki locally