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

Constants cache contains arbitrary-precision mathematical constants.

Implementations

In an ideal situation, the Consts structure is initialized with Consts::new only once, and then used where needed.

Initializes the constants cache.

Errors
  • MemoryAllocation: failed to allocate memory for mantissa.

Returns the value of the pi number with precision p.

Errors
  • MemoryAllocation: failed to allocate memory for mantissa.
  • InvalidArgument: precision is incorrect.

Returns the value of the Euler number with precision p.

Errors
  • MemoryAllocation: failed to allocate memory for mantissa.
  • InvalidArgument: precision is incorrect.

Returns the value of the natural logarithm of 2 with precision p.

Errors
  • MemoryAllocation: failed to allocate memory for mantissa.
  • InvalidArgument: precision is incorrect.

Returns the value of the natural logarithm of 10 with precision p using rounding mode rm.

Errors
  • MemoryAllocation: failed to allocate memory for mantissa.
  • InvalidArgument: precision is incorrect.

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 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.