pub struct SignedPreciseNumber {
pub value: PreciseNumber,
pub is_negative: bool,
}Expand description
Struct encapsulating a signed fixed-point number that allows for decimal calculations
Fields
value: PreciseNumberis_negative: boolImplementations
sourceimpl SignedPreciseNumber
impl SignedPreciseNumber
pub fn negate(&self) -> SignedPreciseNumber
pub fn checked_mul(&self, rhs: &Self) -> Option<SignedPreciseNumber>
pub fn checked_div(&self, rhs: &Self) -> Option<SignedPreciseNumber>
pub fn checked_add(&self, rhs: &Self) -> Option<SignedPreciseNumber>
pub fn checked_sub(&self, rhs: &Self) -> Option<SignedPreciseNumber>
pub fn floor(&self) -> Option<SignedPreciseNumber>
sourcepub fn exp(&self) -> Option<PreciseNumber>
pub fn exp(&self) -> Option<PreciseNumber>
Calculate the exponential of x, that is, e raised to the power x
(where e is the base of the natural system of logarithms, approximately 2.71828).
Note that precision can start to get inaccurate for larger numbers (> 20).
pub fn print(&self)
Trait Implementations
sourceimpl Clone for SignedPreciseNumber
impl Clone for SignedPreciseNumber
sourcefn clone(&self) -> SignedPreciseNumber
fn clone(&self) -> SignedPreciseNumber
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SignedPreciseNumber
impl Debug for SignedPreciseNumber
sourceimpl PartialEq<SignedPreciseNumber> for SignedPreciseNumber
impl PartialEq<SignedPreciseNumber> for SignedPreciseNumber
sourcefn eq(&self, other: &SignedPreciseNumber) -> bool
fn eq(&self, other: &SignedPreciseNumber) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SignedPreciseNumber) -> bool
fn ne(&self, other: &SignedPreciseNumber) -> bool
This method tests for !=.
impl StructuralPartialEq for SignedPreciseNumber
Auto Trait Implementations
impl RefUnwindSafe for SignedPreciseNumber
impl Send for SignedPreciseNumber
impl Sync for SignedPreciseNumber
impl Unpin for SignedPreciseNumber
impl UnwindSafe for SignedPreciseNumber
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more