@@ -423,31 +423,32 @@ julia> total_cookies = cookie_rate * total_milk
42342392.7 cookies
424424```
425425
426- Exponents are tracked by default with the type ` R = FixedRational{Int32,C} ` ,
427- which represents rational numbers with a fixed denominator ` C ` .
426+ Exponents are tracked by default with the type ` FRInt32 ` (alias for ` FixedRational{Int32, 25200} ` ) ,
427+ which represents rational numbers with an integer numerator and fixed denominator.
428428This is much faster than ` Rational ` .
429429
430430``` julia
431431julia> typeof (0.5 u " kg" )
432- Quantity{Float64, Dimensions{FixedRational{Int32, 25200 } }}
432+ Quantity{Float64, Dimensions{FRInt32 }}
433433```
434434
435435You can change the type of the value field by initializing with a value
436436explicitly of the desired type.
437437
438438``` julia
439439julia> typeof (Quantity (Float16 (0.5 ), mass= 1 , length= 1 ))
440- Quantity{Float16, Dimensions{FixedRational{Int32, 25200 } }}
440+ Quantity{Float16, Dimensions{FRInt32 }}
441441```
442442
443443or by conversion:
444444
445445``` julia
446446julia> typeof (convert (Quantity{Float16}, 0.5 u " m/s" ))
447- Quantity{Float16, Dimensions{FixedRational{Int32, 25200 } }}
447+ Quantity{Float16, Dimensions{FRInt32 }}
448448```
449449
450- For many applications, ` FixedRational{Int8,6} ` will suffice,
450+ For many applications, using ` FRInt8 ` (alias for ` FixedRational{Int8,12} ` )
451+ will suffice as the base dimensions type,
451452and can be faster as it means the entire ` Dimensions `
452453struct will fit into 64 bits.
453454You can change the type of the dimensions field by passing
@@ -456,13 +457,9 @@ the type you wish to use as the second argument to `Quantity`:
456457``` julia
457458julia> using DynamicQuantities
458459
459- julia> R8 = Dimensions{FixedRational{Int8, 6 }} ;
460+ julia> q8 = [ Quantity {Float64,FRInt8} ( randn (), length = rand ( - 2 : 2 )) for i in 1 : 1000 ] ;
460461
461- julia> R32 = Dimensions{FixedRational{Int32,2 ^ 4 * 3 ^ 2 * 5 ^ 2 * 7 }}; # Default
462-
463- julia> q8 = [Quantity {Float64,R8} (randn (), length= rand (- 2 : 2 )) for i in 1 : 1000 ];
464-
465- julia> q32 = [Quantity {Float64,R32} (randn (), length= rand (- 2 : 2 )) for i in 1 : 1000 ];
462+ julia> q32 = [Quantity {Float64,FRInt32} (randn (), length= rand (- 2 : 2 )) for i in 1 : 1000 ];
466463
467464julia> f (x) = @. x ^ 2 * 0.5 ;
468465
0 commit comments