Struct astro_float::Consts
source · pub struct Consts { /* private fields */ }
Expand description
Constants cache contains arbitrary-precision mathematical constants.
Implementations§
source§impl Consts
impl Consts
In an ideal situation, the Consts
structure is initialized with Consts::new
only once,
and then used where needed.
sourcepub fn pi(&mut self, p: usize, rm: RoundingMode) -> BigFloat
pub fn pi(&mut self, p: usize, rm: RoundingMode) -> BigFloat
Returns the value of the pi number with precision p
using rounding mode rm
.
Precision is rounded upwards to the word size.
sourcepub fn e(&mut self, p: usize, rm: RoundingMode) -> BigFloat
pub fn e(&mut self, p: usize, rm: RoundingMode) -> BigFloat
Returns the value of the Euler number with precision p
using rounding mode rm
.
Precision is rounded upwards to the word size.
sourcepub fn ln_2(&mut self, p: usize, rm: RoundingMode) -> BigFloat
pub fn ln_2(&mut self, p: usize, rm: RoundingMode) -> BigFloat
Returns the value of the natural logarithm of 2 with precision p
using rounding mode rm
.
Precision is rounded upwards to the word size.
sourcepub fn ln_10(&mut self, p: usize, rm: RoundingMode) -> BigFloat
pub fn ln_10(&mut self, p: usize, rm: RoundingMode) -> BigFloat
Returns the value of the natural logarithm of 10 with precision p
using rounding mode rm
.
Precision is rounded upwards to the word size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Consts
impl RefUnwindSafe for Consts
impl Send for Consts
impl Sync for Consts
impl Unpin for Consts
impl UnwindSafe for Consts
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more