Enum fixed_decimal::decimal::DoublePrecision
source · [−]pub enum DoublePrecision {
Integer,
Magnitude(i16, RoundingMode),
SignificantDigits(u8, RoundingMode),
Maximum,
}
Expand description
Specifies the precision of a floating point value when constructing a FixedDecimal.
IEEE 754 is a representation of a point on the number line. On the other hand, FixedDecimal specifies not only the point on the number line but also the precision of the number to a specific power of 10. This enum augments a floating-point value with the additional information required by FixedDecimal.
Variants
Integer
Specify that the floating point number is integer-valued.
If the floating point is not actually integer-valued, an error will be returned.
Magnitude(i16, RoundingMode)
Specify that the floating point number is precise to a specific power of 10. The number may be rounded or trailing zeros may be added as necessary.
SignificantDigits(u8, RoundingMode)
Specify that the floating point number is precise to a specific number of significant digits. The number may be rounded or trailing zeros may be added as necessary.
The number requested may not be zero
Maximum
Specify that the floating point number is precise to the maximum representable by IEEE.
This results in a FixedDecimal having enough digits to recover the original floating point value, with no trailing zeros.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DoublePrecision
impl Send for DoublePrecision
impl Sync for DoublePrecision
impl Unpin for DoublePrecision
impl UnwindSafe for DoublePrecision
Blanket Implementations
Mutably borrows from an owned value. Read more