Struct arpfloat::BigInt

source ·
pub struct BigInt<const PARTS: usize> { /* private fields */ }
Expand description

This is a fixed-size big int implementation that’s used to represent the significand part of the floating point number.

Implementations§

Create a new zero big int number.

Create a new number with the value 1.

Create a new number with a single ‘1’ set at bit bit.

Create a new number, where the first bits bits are set to 1.

Create a number and set the lowest 64 bits to val.

Create a number and set the lowest 128 bits to val.

Returns the lowest 64 bits.

Returns the lowest 64 bits.

Convert this instance to a smaller number. Notice that this may truncate the number.

\return true if the number is equal to zero.

Returns true if this number is even.

Returns true if this number is odd.

Flip the bit_num bit.

Zero out all of the bits above bits.

Returns the fractional part that’s lost during truncation at bit.

Returns the index of the most significant bit (the highest ‘1’), using 1-based counting (the first bit is 1, and zero means no bits are set).

Returns the index of the first ‘1’ in the number. The number must not be a zero.

Add rhs to self, and return true if the operation overflowed.

Add rhs to self, and return true if the operation overflowed (borrow).

Multiply rhs to self, and return true if the operation overflowed. The generic parameter P2 is here to work around a limitation in the rust generic system. P2 needs to be greater or equal to PARTS*2.

Divide self by divisor, and return the reminder.

Shift the bits in the numbers bits to the left.

Shift the bits in the numbers bits to the right.

\return raise this number to the power of exp.

\return the word at idx idx.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The resulting type after applying the - operator.
Performs the - operation. 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
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.