Struct astro_float::ctx::Context
source · pub struct Context { /* private fields */ }Expand description
Context contains parameters, like rounding mode and precision, as well as constant values, and is used with expr! macro.
Implementations§
source§impl Context
impl Context
sourcepub fn to_raw_parts(self) -> (usize, RoundingMode, Consts)
pub fn to_raw_parts(self) -> (usize, RoundingMode, Consts)
Destructures the context and returns its parts.
sourcepub fn set_precision(&mut self, p: usize)
pub fn set_precision(&mut self, p: usize)
Sets the precision of the context.
sourcepub fn set_rounding_mode(&mut self, rm: RoundingMode)
pub fn set_rounding_mode(&mut self, rm: RoundingMode)
Sets the rounding mode of the context.
sourcepub fn set_consts(&mut self, cc: Consts)
pub fn set_consts(&mut self, cc: Consts)
Sets the constant cache of the context.
sourcepub fn rounding_mode(&self) -> RoundingMode
pub fn rounding_mode(&self) -> RoundingMode
Returns the rounding mode of the context.
sourcepub fn consts(&mut self) -> &mut Consts
pub fn consts(&mut self) -> &mut Consts
Returns a mutable reference to the constant cache of the context.
sourcepub fn const_ln10(&mut self) -> BigFloat
pub fn const_ln10(&mut self) -> BigFloat
Returns the value of the natural logarithm of 10.
Trait Implementations§
source§impl Contextable for Context
impl Contextable for Context
source§fn rounding_mode(&self) -> RoundingMode
fn rounding_mode(&self) -> RoundingMode
Returns the rounding mode of the context.
source§fn consts(&mut self) -> &mut Consts
fn consts(&mut self) -> &mut Consts
Returns a mutable reference to the constant cache of the context.
source§fn const_ln10(&mut self) -> BigFloat
fn const_ln10(&mut self) -> BigFloat
Returns the value of the natural logarithm of 10.
Auto Trait Implementations§
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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