pub struct BigFloat { /* private fields */ }
Expand description

Number representation.

Implementations

Return new BigFloat with value zero.

Create a BigFloat value from a sequence of bytes. Each byte must represent a decimal digit. First byte is the most significant. The length of bytes can be any. If the length of bytes is greater than required, then the remaining part is ignored. If sign is negative, then the resulting BigFloat will be negative.

Get BigFloat’s mantissa as bytes. Each byte represents a decimal digit. First byte is the most significant. The length of bytes can be any. If the length of bytes is smaller than required, then remaining part of mantissa will be omitted.

The length of mantissa can be determined using get_mantissa_len.

Return the number of decimal positions filled in the mantissa.

Return 1 if BigFloat is positive, -1 otherwise.

Return exponent part.

Add d2 and return result of addition.

Errors

ExponentOverflow - in case of too big or too small numbers.

Subtract d2 and return result of subtraction.

Errors

ExponentOverflow - in case of too big or too small numbers.

Multiply by d2 and return result of multiplication.

Errors

ExponentOverflow - in case of too big or too small numbers.

Divide by d2 and return result of division.

Errors

ExponentOverflow - in case of too big or too small numbers. DivisionByZero - in case of d2 equal to zero.

Compare to d2. Returns positive if self > d2, negative if self < d2, 0 otherwise.

Return raw parts of BigFloat: mantissa, number of decimal positions in mantissa, sing, and exponent.

Construct BigFloat from raw parts.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.