Struct bigdecimal::BigDecimal [−][src]
pub struct BigDecimal { /* fields omitted */ }
A big decimal type.
Methods
impl BigDecimal
[src]
impl BigDecimal
pub fn new(digits: BigInt, scale: i64) -> BigDecimal
[src]
pub fn new(digits: BigInt, scale: i64) -> BigDecimal
Creates and initializes a BigDecimal
.
pub fn parse_bytes(buf: &[u8], radix: u32) -> Option<BigDecimal>
[src]
pub fn parse_bytes(buf: &[u8], radix: u32) -> Option<BigDecimal>
Creates and initializes a BigDecimal
.
Examples
use bigdecimal::{BigDecimal, Zero}; assert_eq!(BigDecimal::parse_bytes(b"0", 10).unwrap(), BigDecimal::zero()); // assert_eq!(BigDecimal::parse_bytes(b"f", 16), BigDecimal::parse_bytes(b"16", 10));
pub fn with_scale(&self, new_scale: i64) -> BigDecimal
[src]
pub fn with_scale(&self, new_scale: i64) -> BigDecimal
Return a new BigDecimal object equivalent to self, with internal scaling set to the number specified. If the new_scale is lower than the current value (indicating a larger power of 10), digits will be dropped (as precision is lower)
pub fn with_prec(&self, prec: u64) -> BigDecimal
[src]
pub fn with_prec(&self, prec: u64) -> BigDecimal
Return a new BigDecimal object with precision set to new value
pub fn sign(&self) -> Sign
[src]
pub fn sign(&self) -> Sign
Return the sign of the BigDecimal
as num::bigint::Sign
.
Examples
extern crate num_bigint; extern crate bigdecimal; use std::str::FromStr; assert_eq!(bigdecimal::BigDecimal::from_str("-1").unwrap().sign(), num_bigint::Sign::Minus); assert_eq!(bigdecimal::BigDecimal::from_str("0").unwrap().sign(), num_bigint::Sign::NoSign); assert_eq!(bigdecimal::BigDecimal::from_str("1").unwrap().sign(), num_bigint::Sign::Plus);
pub fn as_bigint_and_exponent(&self) -> (BigInt, i64)
[src]
pub fn as_bigint_and_exponent(&self) -> (BigInt, i64)
Return the internal big integer value and an exponent. Note that a positive exponent indicates a negative power of 10.
Examples
extern crate num_bigint; extern crate bigdecimal; use std::str::FromStr; assert_eq!(bigdecimal::BigDecimal::from_str("1.1").unwrap().as_bigint_and_exponent(), (num_bigint::BigInt::from_str("11").unwrap(), 1));
pub fn into_bigint_and_exponent(self) -> (BigInt, i64)
[src]
pub fn into_bigint_and_exponent(self) -> (BigInt, i64)
Convert into the internal big integer value and an exponent. Note that a positive exponent indicates a negative power of 10.
Examples
extern crate num_bigint; extern crate bigdecimal; use std::str::FromStr; assert_eq!(bigdecimal::BigDecimal::from_str("1.1").unwrap().into_bigint_and_exponent(), (num_bigint::BigInt::from_str("11").unwrap(), 1));
pub fn digits(&self) -> u64
[src]
pub fn digits(&self) -> u64
Number of digits in the non-scaled integer representation
pub fn abs(&self) -> BigDecimal
[src]
pub fn abs(&self) -> BigDecimal
Compute the absolute value of number
pub fn double(&self) -> BigDecimal
[src]
pub fn double(&self) -> BigDecimal
pub fn half(&self) -> BigDecimal
[src]
pub fn half(&self) -> BigDecimal
Divide this efficiently by 2
Note, if this is odd, the precision will increase by 1, regardless of the context's limit.
pub fn square(&self) -> BigDecimal
[src]
pub fn square(&self) -> BigDecimal
pub fn cube(&self) -> BigDecimal
[src]
pub fn cube(&self) -> BigDecimal
pub fn sqrt(&self) -> Option<BigDecimal>
[src]
pub fn sqrt(&self) -> Option<BigDecimal>
Take the square root of the number
If the value is < 0, None is returned
pub fn cbrt(&self) -> BigDecimal
[src]
pub fn cbrt(&self) -> BigDecimal
Take the cube root of the number
pub fn exp(&self) -> BigDecimal
[src]
pub fn exp(&self) -> BigDecimal
Evaluate the natural-exponential function $e^x$
Trait Implementations
impl Clone for BigDecimal
[src]
impl Clone for BigDecimal
fn clone(&self) -> BigDecimal
[src]
fn clone(&self) -> BigDecimal
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for BigDecimal
[src]
impl Eq for BigDecimal
impl FromStr for BigDecimal
[src]
impl FromStr for BigDecimal
type Err = ParseBigDecimalError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<BigDecimal, ParseBigDecimalError>
[src]
fn from_str(s: &str) -> Result<BigDecimal, ParseBigDecimalError>
Parses a string s
to return a value of this type. Read more
impl Hash for BigDecimal
[src]
impl Hash for BigDecimal
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd for BigDecimal
[src]
impl PartialOrd for BigDecimal
fn partial_cmp(&self, other: &BigDecimal) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BigDecimal) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for BigDecimal
[src]
impl Ord for BigDecimal
fn cmp(&self, other: &BigDecimal) -> Ordering
[src]
fn cmp(&self, other: &BigDecimal) -> Ordering
Complete ordering implementation for BigDecimal
Example
use std::str::FromStr; let a = bigdecimal::BigDecimal::from_str("-1").unwrap(); let b = bigdecimal::BigDecimal::from_str("1").unwrap(); assert!(a < b); assert!(b > a); let c = bigdecimal::BigDecimal::from_str("1").unwrap(); assert!(b >= c); assert!(c >= b); let d = bigdecimal::BigDecimal::from_str("10.0").unwrap(); assert!(d > c); let e = bigdecimal::BigDecimal::from_str(".5").unwrap(); assert!(e < c);
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialEq for BigDecimal
[src]
impl PartialEq for BigDecimal
fn eq(&self, rhs: &BigDecimal) -> bool
[src]
fn eq(&self, rhs: &BigDecimal) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Default for BigDecimal
[src]
impl Default for BigDecimal
fn default() -> BigDecimal
[src]
fn default() -> BigDecimal
Returns the "default value" for a type. Read more
impl Zero for BigDecimal
[src]
impl Zero for BigDecimal
fn zero() -> BigDecimal
[src]
fn zero() -> BigDecimal
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl One for BigDecimal
[src]
impl One for BigDecimal
fn one() -> BigDecimal
[src]
fn one() -> BigDecimal
Returns the multiplicative identity element of Self
, 1
. Read more
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
Returns true
if self
is equal to the multiplicative identity. Read more
impl Add<BigDecimal> for BigDecimal
[src]
impl Add<BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the +
operator.
fn add(self, rhs: BigDecimal) -> BigDecimal
[src]
fn add(self, rhs: BigDecimal) -> BigDecimal
Performs the +
operation.
impl<'a> Add<&'a BigDecimal> for BigDecimal
[src]
impl<'a> Add<&'a BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the +
operator.
fn add(self, rhs: &'a BigDecimal) -> BigDecimal
[src]
fn add(self, rhs: &'a BigDecimal) -> BigDecimal
Performs the +
operation.
impl<'a> Add<BigDecimal> for &'a BigDecimal
[src]
impl<'a> Add<BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the +
operator.
fn add(self, rhs: BigDecimal) -> BigDecimal
[src]
fn add(self, rhs: BigDecimal) -> BigDecimal
Performs the +
operation.
impl<'a, 'b> Add<&'b BigDecimal> for &'a BigDecimal
[src]
impl<'a, 'b> Add<&'b BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the +
operator.
fn add(self, rhs: &BigDecimal) -> BigDecimal
[src]
fn add(self, rhs: &BigDecimal) -> BigDecimal
Performs the +
operation.
impl AddAssign<BigDecimal> for BigDecimal
[src]
impl AddAssign<BigDecimal> for BigDecimal
fn add_assign(&mut self, other: BigDecimal)
[src]
fn add_assign(&mut self, other: BigDecimal)
Performs the +=
operation.
impl<'a> AddAssign<&'a BigDecimal> for BigDecimal
[src]
impl<'a> AddAssign<&'a BigDecimal> for BigDecimal
fn add_assign(&mut self, rhs: &BigDecimal)
[src]
fn add_assign(&mut self, rhs: &BigDecimal)
Performs the +=
operation.
impl Sub<BigDecimal> for BigDecimal
[src]
impl Sub<BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn sub(self, rhs: BigDecimal) -> BigDecimal
[src]
fn sub(self, rhs: BigDecimal) -> BigDecimal
Performs the -
operation.
impl<'a> Sub<&'a BigDecimal> for BigDecimal
[src]
impl<'a> Sub<&'a BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a BigDecimal) -> BigDecimal
[src]
fn sub(self, rhs: &'a BigDecimal) -> BigDecimal
Performs the -
operation.
impl<'a> Sub<BigDecimal> for &'a BigDecimal
[src]
impl<'a> Sub<BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn sub(self, rhs: BigDecimal) -> BigDecimal
[src]
fn sub(self, rhs: BigDecimal) -> BigDecimal
Performs the -
operation.
impl<'a, 'b> Sub<&'b BigDecimal> for &'a BigDecimal
[src]
impl<'a, 'b> Sub<&'b BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn sub(self, rhs: &BigDecimal) -> BigDecimal
[src]
fn sub(self, rhs: &BigDecimal) -> BigDecimal
Performs the -
operation.
impl SubAssign<BigDecimal> for BigDecimal
[src]
impl SubAssign<BigDecimal> for BigDecimal
fn sub_assign(&mut self, other: BigDecimal)
[src]
fn sub_assign(&mut self, other: BigDecimal)
Performs the -=
operation.
impl<'a> SubAssign<&'a BigDecimal> for BigDecimal
[src]
impl<'a> SubAssign<&'a BigDecimal> for BigDecimal
fn sub_assign(&mut self, rhs: &BigDecimal)
[src]
fn sub_assign(&mut self, rhs: &BigDecimal)
Performs the -=
operation.
impl Mul<BigDecimal> for BigDecimal
[src]
impl Mul<BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the *
operator.
fn mul(self, rhs: BigDecimal) -> BigDecimal
[src]
fn mul(self, rhs: BigDecimal) -> BigDecimal
Performs the *
operation.
impl<'a> Mul<&'a BigDecimal> for BigDecimal
[src]
impl<'a> Mul<&'a BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a BigDecimal) -> BigDecimal
[src]
fn mul(self, rhs: &'a BigDecimal) -> BigDecimal
Performs the *
operation.
impl<'a> Mul<BigDecimal> for &'a BigDecimal
[src]
impl<'a> Mul<BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the *
operator.
fn mul(self, rhs: BigDecimal) -> BigDecimal
[src]
fn mul(self, rhs: BigDecimal) -> BigDecimal
Performs the *
operation.
impl<'a, 'b> Mul<&'b BigDecimal> for &'a BigDecimal
[src]
impl<'a, 'b> Mul<&'b BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the *
operator.
fn mul(self, rhs: &BigDecimal) -> BigDecimal
[src]
fn mul(self, rhs: &BigDecimal) -> BigDecimal
Performs the *
operation.
impl MulAssign<BigDecimal> for BigDecimal
[src]
impl MulAssign<BigDecimal> for BigDecimal
fn mul_assign(&mut self, other: BigDecimal)
[src]
fn mul_assign(&mut self, other: BigDecimal)
Performs the *=
operation.
impl<'a> MulAssign<&'a BigDecimal> for BigDecimal
[src]
impl<'a> MulAssign<&'a BigDecimal> for BigDecimal
fn mul_assign(&mut self, rhs: &BigDecimal)
[src]
fn mul_assign(&mut self, rhs: &BigDecimal)
Performs the *=
operation.
impl<'a> Div<f32> for &'a BigDecimal
[src]
impl<'a> Div<f32> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: f32) -> Self::Output
[src]
fn div(self, den: f32) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for f32
[src]
impl<'a> Div<&'a BigDecimal> for f32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for f32
[src]
impl Div<BigDecimal> for f32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<f64> for &'a BigDecimal
[src]
impl<'a> Div<f64> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: f64) -> Self::Output
[src]
fn div(self, den: f64) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for f64
[src]
impl<'a> Div<&'a BigDecimal> for f64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for f64
[src]
impl Div<BigDecimal> for f64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<i8> for BigDecimal
[src]
impl<'a> Div<i8> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i8) -> Self::Output
[src]
fn div(self, den: i8) -> Self::Output
Performs the /
operation.
impl<'a> Div<i8> for &'a BigDecimal
[src]
impl<'a> Div<i8> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i8) -> Self::Output
[src]
fn div(self, den: i8) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for i8
[src]
impl<'a> Div<&'a BigDecimal> for i8
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for i8
[src]
impl Div<BigDecimal> for i8
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<i16> for BigDecimal
[src]
impl<'a> Div<i16> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i16) -> Self::Output
[src]
fn div(self, den: i16) -> Self::Output
Performs the /
operation.
impl<'a> Div<i16> for &'a BigDecimal
[src]
impl<'a> Div<i16> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i16) -> Self::Output
[src]
fn div(self, den: i16) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for i16
[src]
impl<'a> Div<&'a BigDecimal> for i16
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for i16
[src]
impl Div<BigDecimal> for i16
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<i32> for BigDecimal
[src]
impl<'a> Div<i32> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i32) -> Self::Output
[src]
fn div(self, den: i32) -> Self::Output
Performs the /
operation.
impl<'a> Div<i32> for &'a BigDecimal
[src]
impl<'a> Div<i32> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i32) -> Self::Output
[src]
fn div(self, den: i32) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for i32
[src]
impl<'a> Div<&'a BigDecimal> for i32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for i32
[src]
impl Div<BigDecimal> for i32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<i64> for BigDecimal
[src]
impl<'a> Div<i64> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i64) -> Self::Output
[src]
fn div(self, den: i64) -> Self::Output
Performs the /
operation.
impl<'a> Div<i64> for &'a BigDecimal
[src]
impl<'a> Div<i64> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: i64) -> Self::Output
[src]
fn div(self, den: i64) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for i64
[src]
impl<'a> Div<&'a BigDecimal> for i64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for i64
[src]
impl Div<BigDecimal> for i64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<u8> for &'a BigDecimal
[src]
impl<'a> Div<u8> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: u8) -> Self::Output
[src]
fn div(self, den: u8) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for u8
[src]
impl<'a> Div<&'a BigDecimal> for u8
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for u8
[src]
impl Div<BigDecimal> for u8
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<u16> for &'a BigDecimal
[src]
impl<'a> Div<u16> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: u16) -> Self::Output
[src]
fn div(self, den: u16) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for u16
[src]
impl<'a> Div<&'a BigDecimal> for u16
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for u16
[src]
impl Div<BigDecimal> for u16
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<u32> for &'a BigDecimal
[src]
impl<'a> Div<u32> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: u32) -> Self::Output
[src]
fn div(self, den: u32) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for u32
[src]
impl<'a> Div<&'a BigDecimal> for u32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for u32
[src]
impl Div<BigDecimal> for u32
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl<'a> Div<u64> for &'a BigDecimal
[src]
impl<'a> Div<u64> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: u64) -> Self::Output
[src]
fn div(self, den: u64) -> Self::Output
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for u64
[src]
impl<'a> Div<&'a BigDecimal> for u64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: &'a BigDecimal) -> Self::Output
[src]
fn div(self, den: &'a BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for u64
[src]
impl Div<BigDecimal> for u64
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, den: BigDecimal) -> Self::Output
[src]
fn div(self, den: BigDecimal) -> Self::Output
Performs the /
operation.
impl Div<BigDecimal> for BigDecimal
[src]
impl Div<BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, other: BigDecimal) -> BigDecimal
[src]
fn div(self, other: BigDecimal) -> BigDecimal
Performs the /
operation.
impl<'a> Div<&'a BigDecimal> for BigDecimal
[src]
impl<'a> Div<&'a BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, other: &'a BigDecimal) -> BigDecimal
[src]
fn div(self, other: &'a BigDecimal) -> BigDecimal
Performs the /
operation.
impl<'a> Div<BigDecimal> for &'a BigDecimal
[src]
impl<'a> Div<BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, other: BigDecimal) -> BigDecimal
[src]
fn div(self, other: BigDecimal) -> BigDecimal
Performs the /
operation.
impl<'a, 'b> Div<&'b BigDecimal> for &'a BigDecimal
[src]
impl<'a, 'b> Div<&'b BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the /
operator.
fn div(self, other: &BigDecimal) -> BigDecimal
[src]
fn div(self, other: &BigDecimal) -> BigDecimal
Performs the /
operation.
impl Rem<BigDecimal> for BigDecimal
[src]
impl Rem<BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the %
operator.
fn rem(self, other: BigDecimal) -> BigDecimal
[src]
fn rem(self, other: BigDecimal) -> BigDecimal
Performs the %
operation.
impl<'a> Rem<&'a BigDecimal> for BigDecimal
[src]
impl<'a> Rem<&'a BigDecimal> for BigDecimal
type Output = BigDecimal
The resulting type after applying the %
operator.
fn rem(self, other: &BigDecimal) -> BigDecimal
[src]
fn rem(self, other: &BigDecimal) -> BigDecimal
Performs the %
operation.
impl<'a> Rem<BigDecimal> for &'a BigDecimal
[src]
impl<'a> Rem<BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the %
operator.
fn rem(self, other: BigDecimal) -> BigDecimal
[src]
fn rem(self, other: BigDecimal) -> BigDecimal
Performs the %
operation.
impl<'a, 'b> Rem<&'b BigDecimal> for &'a BigDecimal
[src]
impl<'a, 'b> Rem<&'b BigDecimal> for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the %
operator.
fn rem(self, other: &BigDecimal) -> BigDecimal
[src]
fn rem(self, other: &BigDecimal) -> BigDecimal
Performs the %
operation.
impl Neg for BigDecimal
[src]
impl Neg for BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn neg(self) -> BigDecimal
[src]
fn neg(self) -> BigDecimal
Performs the unary -
operation.
impl<'a> Neg for &'a BigDecimal
[src]
impl<'a> Neg for &'a BigDecimal
type Output = BigDecimal
The resulting type after applying the -
operator.
fn neg(self) -> BigDecimal
[src]
fn neg(self) -> BigDecimal
Performs the unary -
operation.
impl Signed for BigDecimal
[src]
impl Signed for BigDecimal
fn abs(&self) -> BigDecimal
[src]
fn abs(&self) -> BigDecimal
Computes the absolute value. Read more
fn abs_sub(&self, other: &BigDecimal) -> BigDecimal
[src]
fn abs_sub(&self, other: &BigDecimal) -> BigDecimal
The positive difference of two numbers. Read more
fn signum(&self) -> BigDecimal
[src]
fn signum(&self) -> BigDecimal
Returns the sign of the number. Read more
fn is_positive(&self) -> bool
[src]
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
fn is_negative(&self) -> bool
[src]
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
impl Display for BigDecimal
[src]
impl Display for BigDecimal
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Debug for BigDecimal
[src]
impl Debug for BigDecimal
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Num for BigDecimal
[src]
impl Num for BigDecimal
type FromStrRadixErr = ParseBigDecimalError
fn from_str_radix(
s: &str,
radix: u32
) -> Result<BigDecimal, ParseBigDecimalError>
[src]
fn from_str_radix(
s: &str,
radix: u32
) -> Result<BigDecimal, ParseBigDecimalError>
Creates and initializes a BigDecimal.
impl ToPrimitive for BigDecimal
[src]
impl ToPrimitive for BigDecimal
fn to_i64(&self) -> Option<i64>
[src]
fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
.
fn to_u64(&self) -> Option<u64>
[src]
fn to_u64(&self) -> Option<u64>
Converts the value of self
to an u64
.
fn to_f64(&self) -> Option<f64>
[src]
fn to_f64(&self) -> Option<f64>
Converts the value of self
to an f64
.
fn to_isize(&self) -> Option<isize>
[src]
fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
.
fn to_i8(&self) -> Option<i8>
[src]
fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
.
fn to_i16(&self) -> Option<i16>
[src]
fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
.
fn to_i32(&self) -> Option<i32>
[src]
fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
.
fn to_i128(&self) -> Option<i128>
[src]
fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. Read more
fn to_usize(&self) -> Option<usize>
[src]
fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
.
fn to_u8(&self) -> Option<u8>
[src]
fn to_u8(&self) -> Option<u8>
Converts the value of self
to an u8
.
fn to_u16(&self) -> Option<u16>
[src]
fn to_u16(&self) -> Option<u16>
Converts the value of self
to an u16
.
fn to_u32(&self) -> Option<u32>
[src]
fn to_u32(&self) -> Option<u32>
Converts the value of self
to an u32
.
fn to_u128(&self) -> Option<u128>
[src]
fn to_u128(&self) -> Option<u128>
Converts the value of self
to an u128
. Read more
fn to_f32(&self) -> Option<f32>
[src]
fn to_f32(&self) -> Option<f32>
Converts the value of self
to an f32
.
impl From<i64> for BigDecimal
[src]
impl From<i64> for BigDecimal
impl From<u64> for BigDecimal
[src]
impl From<u64> for BigDecimal
impl From<(BigInt, i64)> for BigDecimal
[src]
impl From<(BigInt, i64)> for BigDecimal
impl From<u8> for BigDecimal
[src]
impl From<u8> for BigDecimal
impl From<u16> for BigDecimal
[src]
impl From<u16> for BigDecimal
impl From<u32> for BigDecimal
[src]
impl From<u32> for BigDecimal
impl From<i8> for BigDecimal
[src]
impl From<i8> for BigDecimal
impl From<i16> for BigDecimal
[src]
impl From<i16> for BigDecimal
impl From<i32> for BigDecimal
[src]
impl From<i32> for BigDecimal
impl From<f32> for BigDecimal
[src]
impl From<f32> for BigDecimal
impl From<f64> for BigDecimal
[src]
impl From<f64> for BigDecimal
impl FromPrimitive for BigDecimal
[src]
impl FromPrimitive for BigDecimal
fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i64(n: i64) -> Option<Self>
Convert an i64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
Convert an u64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
Convert a f32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_f64(n: f64) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
Convert a f64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_isize(n: isize) -> Option<Self>
Convert an isize
to return an optional value of this type. If the value cannot be represented by this value, then None
is returned. Read more
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
Convert an i8
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
Convert an i16
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
Convert an i32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
Convert an i128
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
Convert a usize
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
Convert an u8
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
Convert an u16
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u32(n: u32) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
Convert an u32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
Convert an u128
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
impl ToBigInt for BigDecimal
[src]
impl ToBigInt for BigDecimal
Auto Trait Implementations
impl Send for BigDecimal
impl Send for BigDecimal
impl Sync for BigDecimal
impl Sync for BigDecimal