Struct astro_float_num::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.