pub enum DoublePrecision {
    Integer,
    Magnitude(i16RoundingMode),
    SignificantDigits(u8RoundingMode),
    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(i16RoundingMode)

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(u8RoundingMode)

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.