Skip to main content

UnsignedDecimal

Struct UnsignedDecimal 

Source
pub struct UnsignedDecimal<const N: usize>(/* private fields */);
Expand description

§Unsigned Decimal

Generic unsigned N-bits decimal number.

Implementations§

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_u8(n: u8) -> Self

Converts u8 to Decimal.

Source

pub const fn from_u16(n: u16) -> Self

Converts u16 to Decimal.

Source

pub const fn from_u32(n: u32) -> Self

Converts u32 to Decimal.

Source

pub const fn from_u64(n: u64) -> Self

Converts u64 to Decimal.

Source

pub const fn from_u128(n: u128) -> Result<Self, ParseError>

Converts u128 to Decimal.

Source

pub const fn from_usize(n: usize) -> Self

Converts usize to Decimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_i8(int: i8) -> Result<Self, ParseError>

Try converts i8 to UnsignedDecimal.

Source

pub const fn from_i16(int: i16) -> Result<Self, ParseError>

Try converts i16 to UnsignedDecimal.

Source

pub const fn from_i32(int: i32) -> Result<Self, ParseError>

Try converts i32 to UnsignedDecimal.

Source

pub const fn from_i64(int: i64) -> Result<Self, ParseError>

Try converts i64 to UnsignedDecimal.

Source

pub const fn from_i128(int: i128) -> Result<Self, ParseError>

Try converts i128 to UnsignedDecimal.

Source

pub const fn from_isize(int: isize) -> Result<Self, ParseError>

Try converts isize to UnsignedDecimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_f32(n: f32) -> Result<Self, ParseError>

Try converts f32 to UnsignedDecimal.

Source

pub const fn from_f64(n: f64) -> Result<Self, ParseError>

Try converts f64 to UnsignedDecimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn to_u8(self) -> Result<u8, ParseError>

Try converts UnsignedDecimal into u8.

Source

pub const fn to_u16(self) -> Result<u16, ParseError>

Try converts UnsignedDecimal into u16.

Source

pub const fn to_u32(self) -> Result<u32, ParseError>

Try converts UnsignedDecimal into u32.

Source

pub const fn to_u64(self) -> Result<u64, ParseError>

Try converts UnsignedDecimal into u64.

Source

pub const fn to_u128(self) -> Result<u128, ParseError>

Try converts UnsignedDecimal into u128.

Source

pub const fn to_usize(self) -> Result<usize, ParseError>

Try converts UnsignedDecimal into usize.

Source

pub const fn to_i8(self) -> Result<i8, ParseError>

Try converts UnsignedDecimal into i8.

Source

pub const fn to_i16(self) -> Result<i16, ParseError>

Try converts UnsignedDecimal into i16.

Source

pub const fn to_i32(self) -> Result<i32, ParseError>

Try converts UnsignedDecimal into i32.

Source

pub const fn to_i64(self) -> Result<i64, ParseError>

Try converts UnsignedDecimal into i64.

Source

pub const fn to_i128(self) -> Result<i128, ParseError>

Try converts UnsignedDecimal into i128.

Source

pub const fn to_isize(self) -> Result<isize, ParseError>

Try converts UnsignedDecimal into isize.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn to_f32(self) -> f32

Converts UnsignedDecimal into f32.

Source

pub const fn to_f64(self) -> f64

Converts UnsignedDecimal into f64.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const NAN: Self

Not A Number value. More about NaN.

Source

pub const INFINITY: Self

Infinity (∞). More about ±Infinity.

Source

pub const MIN: Self = Self::ZERO

The smallest value that can be represented by this decimal type (0).

Source

pub const MAX: Self

The largest value that can be represented by this decimal type (2N − 1)×1032’768.

Source

pub const MIN_POSITIVE: Self

The smallest positive, normalized value that this type can represent.

Source

pub const EPSILON: Self

Machine epsilon value.

This is the difference between 1.0 and the next larger representable number.

Source

pub const ZERO: Self

The value of 0 represented by this decimal type.

Source

pub const ONE: Self

The value of 1 represented by this decimal type.

Source

pub const TWO: Self

The value of 2 represented by this decimal type.

Source

pub const THREE: Self

The value of 3 represented by this decimal type.

Source

pub const FOUR: Self

The value of 4 represented by this decimal type.

Source

pub const FIVE: Self

The value of 5 represented by this decimal type.

Source

pub const SIX: Self

The value of 6 represented by this decimal type.

Source

pub const SEVEN: Self

The value of 7 represented by this decimal type.

Source

pub const EIGHT: Self

The value of 8 represented by this decimal type.

Source

pub const NINE: Self

The value of 9 represented by this decimal type.

Source

pub const TEN: Self

The value of 10 represented by this decimal type.

Source

pub const E: Self

Euler’s number (e).

Source

pub const PI: Self

Archimedes’ constant (π).

Source

pub const TAU: Self

The full circle constant (τ)

Equal to 2π.

Source

pub const FRAC_1_PI: Self

1/π.

Source

pub const FRAC_2_PI: Self

2/π.

Source

pub const FRAC_PI_2: Self

π/2.

Source

pub const FRAC_PI_3: Self

π/3.

Source

pub const FRAC_PI_4: Self

π/4.

Source

pub const FRAC_PI_6: Self

π/6.

Source

pub const FRAC_PI_8: Self

π/8.

Source

pub const FRAC_2_SQRT_PI: Self

2/sqrt(π).

Source

pub const LN_2: Self

ln(2).

Source

pub const LN_10: Self

ln(10).

Source

pub const LOG2_E: Self

log2(e).

Source

pub const LOG10_E: Self

log10(e).

Source

pub const SQRT_2: Self

sqrt(2).

Source

pub const FRAC_1_SQRT_2: Self

1/sqrt(2).

Source

pub const LOG10_2: Self

log10(2).

Source

pub const LOG2_10: Self

log2(10).

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_parts(digits: UInt<N>, exp: i32, ctx: Context) -> Self

Creates and initializes unsigned decimal from parts.

§Examples
use fastnum::{*, decimal::*};

assert_eq!(UD256::from_parts(u256!(12345), -4, Context::default()), udec256!(1.2345));
Source

pub const fn from_str(s: &str, ctx: Context) -> Result<Self, ParseError>

Creates and initializes an unsigned decimal from string.

§Examples
use fastnum::{*, decimal::*};

assert_eq!(UD256::from_str("1.2345", Context::default()), Ok(udec256!(1.2345)));
assert_eq!(UD256::from_str("-1.2345", Context::default()), Err(ParseError::Signed));
Source

pub const fn parse_str(s: &str, ctx: Context) -> Self

Parse an unsigned decimal from string.

§Panics

This function will panic if UnsignedDecimal<N> can’t be constructed from a given string.

§Examples

Basic usage:

use fastnum::{*, decimal::*};

assert_eq!(UD256::parse_str("1.2345", Context::default()), udec256!(1.2345));

Should panic:

use fastnum::{*, decimal::*};

let _ = UD256::parse_str("-1.2345", Context::default());
Source

pub const fn digits(&self) -> UInt<N>

Returns the internal big integer, representing the Coefficient of a given UnsignedDecimal, including significant trailing zeros.

§Examples
use fastnum::{udec256, u256};

let a = udec256!(123.45);
assert_eq!(a.digits(), u256!(12345));

let b = udec256!(1.0);
assert_eq!(b.digits(), u256!(10));
Source

pub const fn digits_count(&self) -> usize

Returns the count of digits in the non-scaled integer representation

Source

pub const fn fractional_digits_count(&self) -> i16

Returns the scale of the UnsignedDecimal, the total number of digits to the right of the decimal point (including insignificant leading zeros).

§Examples
use fastnum::udec256;

let a = udec256!(12345);  // No fractional part
let b = udec256!(123.45);  // Fractional part
let c = udec256!(0.0000012345);  // Completely fractional part
let d = udec256!(500000000);  // No fractional part
let e = udec256!(5e9);  // Negative-fractional part

assert_eq!(a.fractional_digits_count(), 0);
assert_eq!(b.fractional_digits_count(), 2);
assert_eq!(c.fractional_digits_count(), 10);
assert_eq!(d.fractional_digits_count(), 0);
assert_eq!(e.fractional_digits_count(), -9);
Source

pub const fn is_zero(&self) -> bool

Return if the referenced unsigned decimal is zero.

§Examples
use fastnum::{udec256};

let a = udec256!(0);
assert!(a.is_zero());

let b = udec256!(0.0);
assert!(b.is_zero());

let c = udec256!(0.00);
assert!(c.is_zero());

let d = udec256!(0.1);
assert!(!d.is_zero());
Source

pub const fn is_one(&self) -> bool

Return if the referenced unsigned decimal is strictly Self::ONE.

§Examples
use fastnum::{udec256};

let a = udec256!(1);
assert!(a.is_one());

let b = udec256!(10e-1);
assert!(!b.is_one());
Source

pub const fn is_op_div_by_zero(&self) -> bool

Returns true if the given decimal number is the result of division by zero and false otherwise.

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default().without_traps();
let res = udec256!(1.0).with_ctx(ctx) / udec256!(0).with_ctx(ctx);

assert!(res.is_op_div_by_zero());

More about OP_DIV_BY_ZERO signal.

Source

pub const fn is_op_invalid(&self) -> bool

Return true if the argument has Signals::OP_INVALID signal flag, and false otherwise.

Source

pub const fn is_op_subnormal(&self) -> bool

Return true if the argument has Signals::OP_SUBNORMAL signal flag, and false otherwise.

Source

pub const fn is_op_inexact(&self) -> bool

Return true if the argument has Signals::OP_INEXACT signal flag, and false otherwise.

Source

pub const fn is_op_rounded(&self) -> bool

Return true if the argument has Signals::OP_ROUNDED signal flag, and false otherwise.

Source

pub const fn is_op_clamped(&self) -> bool

Return true if the argument has Signals::OP_CLAMPED signal flag, and false otherwise.

Source

pub const fn is_op_overflow(&self) -> bool

Return true if the argument has Signals::OP_OVERFLOW signal flag, and false otherwise.

Source

pub const fn is_op_underflow(&self) -> bool

Return true if the argument has Signals::OP_UNDERFLOW signal flag, and false otherwise.

Source

pub const fn is_op_ok(&self) -> bool

Return true if the argument has no signal flags, and false otherwise.

Source

pub const fn op_signals(&self) -> Signals

Return the signaling block of given unsigned decimal.

Source

pub const fn classify(&self) -> FpCategory

Return the decimal category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

§Examples
use core::num::FpCategory;
use fastnum::{udec256, UD256};

let num = udec256!(12.4);
let inf = UD256::INFINITY;

assert_eq!(num.classify(), FpCategory::Normal);
assert_eq!(inf.classify(), FpCategory::Infinite);
Source

pub const fn is_normal(self) -> bool

Return true if the number is neither zero, Infinity, subnormal, or NaN and false otherwise.

§Examples
use fastnum::*;

let num = udec256!(12.4);
let subnormal = udec256!(1E-30000) / udec256!(1E2768);
let inf = UD256::INFINITY;
let nan = UD256::NAN;
let zero = UD256::ZERO;

assert!(num.is_normal());

assert!(!zero.is_normal());
assert!(!nan.is_normal());
assert!(!nan.is_normal());
assert!(!subnormal.is_normal());
Source

pub const fn is_subnormal(self) -> bool

Return true if the number is subnormal and false otherwise.

§Examples
use fastnum::*;

let num = udec256!(12.4);
let subnormal = udec256!(1E-30000) / udec256!(1E2768);
let inf = UD256::INFINITY;
let nan = UD256::NAN;
let zero = UD256::ZERO;

assert!(subnormal.is_subnormal());

assert!(!num.is_subnormal());
assert!(!zero.is_subnormal());
assert!(!nan.is_subnormal());
assert!(!nan.is_subnormal());
Source

pub const fn is_finite(self) -> bool

Return true if this number is neither Infinity nor NaN and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let d = udec256!(7.0);
let inf = UD256::INFINITY;
let nan = UD256::NAN;

assert!(d.is_finite());

assert!(!nan.is_finite());
assert!(!inf.is_finite());
Source

pub const fn is_infinite(self) -> bool

Return true if this value is Infinity and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let d = udec256!(7.0);
let inf = UD256::INFINITY;
let nan = UD256::NAN;

assert!(inf.is_infinite());

assert!(!d.is_infinite());
assert!(!nan.is_infinite());
Source

pub const fn is_nan(self) -> bool

Return true if this value is NaN and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let nan = UD256::NAN;
let d = udec256!(7.0);

assert!(nan.is_nan());
assert!(!d.is_nan());
Source

pub const fn with_ctx(self, ctx: Context) -> Self

Apply new Context to the given decimal number.

Returns a copy of the value with the provided context applied.

This method updates the operational context (including the rounding mode and other contextual parameters) used by subsequent operations that may round or clamp the value (e.g., add, sub, mul, div, round, rescale, quantize, etc.).

Important:

  • The change is local to the returned value and does not affect other values.
  • If you ignore the returned value, the context update is lost.
  • If the value currently carries extra precision, that extra precision is reconciled immediately with the new context: it is rounded using the context’s rounding mode (and may be clamped as dictated by the context).
  • If the current value already has signaling flags set (e.g., INEXACT and the new context enables traps for those signals, applying this method may trigger the corresponding traps immediately, which can result in a panic (depending on the build/configuration).
§Panics:
§debug mode

This method will panic if

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

let ctx = decimal::Context::default().without_traps();
let a = udec256!(1).with_ctx(ctx);
let b = udec256!(0).with_ctx(ctx);

// No panic! We can divide by zero!
let c = a / b;
assert!(c.is_infinite());
assert!(c.is_op_div_by_zero());

See also:

Source

pub const fn with_rounding_mode(self, rm: RoundingMode) -> Self

Apply new RoundingMode to the given decimal number.

Returns a copy of the value with an updated rounding mode in its context.

This method generally does not immediately change the mathematical value; it only sets the rounding rule that will be used by subsequent operations that may round (e.g., add, sub, mul, div, round, rescale, quantize, conversions, etc.).

Important:

  • The change is local to the returned value and does not affect other values.
  • If you ignore the returned value, the rounding mode update is lost.
  • If the value currently carries extra precision, that extra precision is rounded using the newly provided rounding mode at the moment this method is applied. This ensures internal consistency of the stored representation with the new rounding rule.
§Panics:
§debug mode

This method will panic if possible extra precision rounding operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

let a = udec256!(1).with_rounding_mode(decimal::RoundingMode::No);
let b = udec256!(3).with_rounding_mode(decimal::RoundingMode::No);
let c = udec256!(6).with_rounding_mode(decimal::RoundingMode::No);

assert_eq!(((a / b) * c).with_rounding_mode(decimal::RoundingMode::HalfUp), udec256!(2));

See also:

Source

pub const fn quantum(exp: i32, ctx: Context) -> Self

The quantum of a finite number is given by: 1 × 10exp. This is the value of a unit in the least significant position of the coefficient of a finite number.

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default();

assert_eq!(UD256::quantum(0, ctx), udec256!(1));
assert_eq!(UD256::quantum(-0, ctx), udec256!(1));
assert_eq!(UD256::quantum(-3, ctx), udec256!(0.001));
assert_eq!(UD256::quantum(3, ctx), udec256!(1000));
Source

pub const fn reduce(self) -> Self

Reduces a decimal number to its shortest (coefficient) form shifting all significant trailing zeros into the exponent.

§Examples
use fastnum::{udec256, u256, decimal::Context};

let a = udec256!(1234500);
assert_eq!(a.digits(), u256!(1234500));
assert_eq!(a.fractional_digits_count(), 0);

let b = a.reduce();
assert_eq!(b.digits(), u256!(12345));
assert_eq!(b.fractional_digits_count(), -2);
Source

pub const fn neg(self) -> Decimal<N>

Invert sign of the given unsigned decimal.

§Examples
use fastnum::*;

assert_eq!(udec256!(1.0).neg(), dec256!(-1.0));
Source

pub const fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by == operator.

Source

pub const fn ne(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by == operator.

Source

pub const fn max(self, other: Self) -> Self

Compares and returns the maximum of two unsigned decimal values.

Returns the second argument if the comparison determines them to be equal.

§Examples
use fastnum::{udec256};

assert_eq!(udec256!(1).max(udec256!(2)), udec256!(2));
assert_eq!(udec256!(2).max(udec256!(2)), udec256!(2));
Source

pub const fn min(self, other: Self) -> Self

Compares and returns the minimum of two undecimal values.

Returns the first argument if the comparison determines them to be equal.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1).min(udec256!(2)), udec256!(1));
assert_eq!(udec256!(2).min(udec256!(2)), udec256!(2));
Source

pub const fn clamp(self, min: Self, max: Self) -> Self

Restrict an unsigned decimal value to a certain interval.

Returns max if self is greater than max, and min if self is less than min. Otherwise, this returns self.

§Panics

Panics if min > max.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(0).clamp(udec256!(3), udec256!(5)), udec256!(3));
assert_eq!(udec256!(3).clamp(udec256!(1), udec256!(5)), udec256!(3));
assert_eq!(udec256!(6).clamp(udec256!(1), udec256!(5)), udec256!(5));
Source

pub const fn lt(&self, other: &Self) -> bool

Tests unsigned decimal self less than other and is used by the < operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).lt(&udec256!(1.0)), false);
assert_eq!(udec256!(1.0).lt(&udec256!(2.0)), true);
assert_eq!(udec256!(2.0).lt(&udec256!(1.0)), false);
Source

pub const fn le(&self, other: &Self) -> bool

Tests unsigned decimal self less than or equal to other and is used by the <= operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).le(&udec256!(1.0)), true);
assert_eq!(udec256!(1.0).le(&udec256!(2.0)), true);
assert_eq!(udec256!(2.0).le(&udec256!(1.0)), false);
Source

pub const fn gt(&self, other: &Self) -> bool

Tests unsigned decimal self greater than other and is used by the > operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).gt(&udec256!(1.0)), false);
assert_eq!(udec256!(1.0).gt(&udec256!(2.0)), false);
assert_eq!(udec256!(2.0).gt(&udec256!(1.0)), true);
Source

pub const fn ge(&self, other: &Self) -> bool

Tests unsigned decimal self greater than or equal to other and is used by the >= operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).ge(&udec256!(1.0)), true);
assert_eq!(udec256!(1.0).ge(&udec256!(2.0)), false);
assert_eq!(udec256!(2.0).ge(&udec256!(1.0)), true);
Source

pub const fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other.

By convention, self.cmp(&other) returns the ordering matching the expression self <operator> other if true.

§Examples
use fastnum::udec256;
use std::cmp::Ordering;

assert_eq!(udec256!(5).cmp(&udec256!(10)), Ordering::Less);
assert_eq!(udec256!(10).cmp(&udec256!(5)), Ordering::Greater);
assert_eq!(udec256!(5).cmp(&udec256!(5)), Ordering::Equal);
Source

pub const fn add(self, rhs: Self) -> Self

Calculates self + rhs.

Is internally used by the + operator.

§Panics:
§debug mode

This method will panic if addition operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::ONE;
let b = UD256::TWO;

let c = a + b;
assert_eq!(c, udec256!(3));

Panics if overflowed:

use fastnum::*;

let a = UD256::MAX;
let b = UD256::MAX;

let c = a + b;

See more about add and subtract.

Source

pub const fn sub(self, rhs: Self) -> Self

Calculates selfrhs.

Is internally used by the - operator.

§Panics:
§debug mode

This method will panic if subtract operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a - b;
assert_eq!(c, udec256!(3));

Panics if overflowed:

use fastnum::*;

let a = UD256::ZERO;
let b = UD256::ONE;

let c = a - b;

See more about add and subtract.

Source

pub const fn mul(self, rhs: Self) -> Self

Calculates self × rhs.

Is internally used by the * operator.

§Panics:
§debug mode

This method will panic if multiplication operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a * b;
assert_eq!(c, udec256!(10));

Panics if overflowed:

use fastnum::*;

let a = UD256::MAX;
let b = UD256::MAX;

let c = a * b;

See more about multiplication.

Source

pub const fn div(self, rhs: Self) -> Self

Calculates self ÷ rhs.

Is internally used by the / operator.

§Panics:
§debug mode

This method will panic if divide operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a / b;
assert_eq!(c, udec256!(2.5));

Panics if divided by zero:

use fastnum::*;

let a = UD256::ONE;
let b = UD256::ZERO;

let c = a / b;

See more about division.

Source

pub const fn rem(self, rhs: Self) -> Self

Calculates self % rhs.

Is internally used by the % operator.

§Panics:
§debug mode

This method will panic if reminder operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a % b;
assert_eq!(c, udec256!(1));
Source

pub const fn recip(self) -> Self

Takes the reciprocal (inverse) of a number, 1/x.

§Panics:
§debug mode

This method will panic if reciprocal operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Precision

Since the result of reciprocal is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Examples
use fastnum::*;

assert_eq!(udec256!(2).recip(), udec256!(0.5));
Source

pub const fn pow(self, n: Decimal<N>) -> Self

Raise an unsigned decimal number to decimal power.

Using this function is generally slower than using powi for integer exponents or sqrt method for 1/2 exponent.

§Panics:
§debug mode

This method will panic if power operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec256!(4).pow(dec256!(0.5)), udec256!(2));
assert_eq!(udec256!(8).pow(dec256!(1) / dec256!(3)), udec256!(2));

See more about the power operation.

Source

pub const fn powi(self, n: i32) -> Self

Raise an unsigned decimal number to an integer power.

Using this function is generally faster than using pow

§Panics:
§debug mode

This method will panic if power operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec256!(2).powi(3), udec256!(8));
assert_eq!(udec256!(9).powi(2), udec256!(81));
assert_eq!(udec256!(1).powi(-2), udec256!(1));
assert_eq!(udec256!(10).powi(20), udec256!(1e20));
assert_eq!(udec256!(4).powi(-2), udec256!(0.0625));

See more about the power operation.

Source

pub const fn sqrt(self) -> Self

Take the square root of the unsigned decimal number.

Square-root can also be calculated by using the power operation (with a second operand of 0.5). The result in that case will not be exact and may not be correctly rounded.

§Panics:
§debug mode

This method will panic if sqrt operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(4).sqrt(), udec128!(2));
assert_eq!(udec128!(1).sqrt(), udec128!(1));
assert_eq!(udec128!(16).sqrt(), udec128!(4));

See more about the square-root operation.

Source

pub const fn exp(self) -> Self

Returns eself, (the exponential function).

§Panics:
§debug mode

This method will panic if exponent operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(1).exp(), UD128::E);

See more about the exponential function.

Source

pub const fn ln(self) -> Decimal<N>

Returns the natural logarithm of the decimal number.

§Precision

Since the result of natural logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(2).ln(), D256::LN_2);
assert_eq!(UD256::E.ln(), D256::ONE);

See also:

Source

pub const fn ln_1p(self) -> Decimal<N>

Returns natural logarithm ln(1 + self) more accurately than if the operations were performed separately.

§Precision

Since the result of natural logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!((UD256::E - udec256!(1)).ln_1p(), dec256!(1));

See also:

Source

pub const fn log(self, base: Self) -> Decimal<N>

Returns the logarithm of the decimal number with respect to the given arbitrary base.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(64).log(udec256!(2)), dec256!(6));
assert_eq!(udec256!(27).log(udec256!(3)), dec256!(3));
assert_eq!(udec256!(15625).log(udec256!(5)), dec256!(6));

See also:

Source

pub const fn log2(self) -> Decimal<N>

Returns the binary logarithm of the given decimal number.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(64).log2(), dec256!(6));
assert_eq!(udec256!(32).log2(), dec256!(5));
assert_eq!(udec256!(1024).log2(), dec256!(10));
assert_eq!(udec256!(0.5).log2(), dec256!(-1));
assert_eq!(udec256!(0.25).log2(), dec256!(-2));
assert_eq!(udec256!(10).log2(), D256::LOG2_10);

See also:

Source

pub const fn log10(self) -> Decimal<N>

Returns the decimal logarithm of the given decimal number.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(100).log10(), dec256!(2));
assert_eq!(udec256!(1000).log10(), dec256!(3));
assert_eq!(udec256!(0.1).log10(), dec256!(-1));
assert_eq!(udec256!(0.01).log10(), dec256!(-2));
assert_eq!(udec256!(2).log10(), D256::LOG10_2);

See also:

Source

pub const fn mul_add(self, a: Self, b: Self) -> Self

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add.

§Panics:
§debug mode

This method will panic if multiply-add operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(10.0).mul_add(udec128!(4.0), udec128!(60)), udec128!(100));

See more about the fused multiply-add function.

Source

pub const fn round(self, digits: i16) -> Self

Returns the given decimal number rounded to digits precision after the decimal point, using RoundingMode from it Context.

§Panics:
§debug mode

This method will panic if round operation (up-scale or down-scale) performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::{*, RoundingMode::*}};

let n = udec256!(129.41675);

// Default rounding mode is `HalfUp`
assert_eq!(n.round(2),  udec256!(129.42));

assert_eq!(n.with_rounding_mode(Up).round(2), udec256!(129.42));
assert_eq!(n.with_rounding_mode(Down).round(-1), udec256!(120));
assert_eq!(n.with_rounding_mode(HalfEven).round(4), udec256!(129.4168));

See also:

Source

pub const fn floor(self) -> Self

Returns the largest integer less than or equal to a number.

§Examples
use fastnum::*;

assert_eq!(udec256!(3.99).floor(), udec256!(3));
assert_eq!(udec256!(3.0).floor(), udec256!(3.0));
assert_eq!(udec256!(3.01).floor(), udec256!(3));
assert_eq!(udec256!(3.5).floor(), udec256!(3));
assert_eq!(udec256!(4.0).floor(), udec256!(4));
Source

pub const fn ceil(self) -> Self

Finds the nearest integer greater than or equal to x.

§Examples
use fastnum::*;

assert_eq!(udec256!(3.01).ceil(), udec256!(4));
assert_eq!(udec256!(3.99).ceil(), udec256!(4));
assert_eq!(udec256!(4.0).ceil(), udec256!(4));
assert_eq!(udec256!(1.0001).ceil(), udec256!(2));
assert_eq!(udec256!(1.00001).ceil(), udec256!(2));
assert_eq!(udec256!(1.000001).ceil(), udec256!(2));
assert_eq!(udec256!(1.00000000000001).ceil(), udec256!(2));
Source

pub const fn rescale(self, new_scale: i16) -> Self

Returns the given decimal number re-scaled to digits precision after the decimal point.

§Panics:
§debug mode

This method will panic if rescale operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::*};

assert_eq!(udec256!(2.17).rescale(3), udec256!(2.170));
assert_eq!(udec256!(2.17).rescale(2), udec256!(2.17));
assert_eq!(udec256!(2.17).rescale(1), udec256!(2.2));
assert_eq!(udec256!(2.17).rescale(0), udec256!(2));
assert_eq!(udec256!(2.17).rescale(-1), udec256!(0));

let ctx = Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).rescale(2).is_nan());
assert!(UD256::NAN.with_ctx(ctx).rescale(1).is_nan());

See also:

Source

pub const fn quantize(self, other: Self) -> Self

Returns a value equal to self (rounded), having the exponent of other.

§Panics:
§debug mode

This method will panic if quantize operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default().without_traps();

assert_eq!(udec256!(2.17).quantize(udec256!(0.001)), udec256!(2.170));
assert_eq!(udec256!(2.17).quantize(udec256!(0.01)), udec256!(2.17));
assert_eq!(udec256!(2.17).quantize(udec256!(0.1)), udec256!(2.2));
assert_eq!(udec256!(2.17).quantize(udec256!(1e+0)), udec256!(2));
assert_eq!(udec256!(2.17).quantize(udec256!(1e+1)), udec256!(0));

assert_eq!(UD256::INFINITY.quantize(UD256::INFINITY), UD256::INFINITY);

assert!(udec256!(2).with_ctx(ctx).quantize(UD256::INFINITY).is_nan());

assert_eq!(udec256!(0.1).quantize(udec256!(1)), udec256!(0));
assert_eq!(udec256!(0).quantize(udec256!(1e+5)), udec256!(0E+5));

assert!(udec128!(0.34028).with_ctx(ctx).quantize(udec128!(1e-32765)).is_nan());

assert_eq!(udec256!(217).quantize(udec256!(1e-1)), udec256!(217.0));
assert_eq!(udec256!(217).quantize(udec256!(1e+0)), udec256!(217));
assert_eq!(udec256!(217).quantize(udec256!(1e+1)), udec256!(2.2E+2));
assert_eq!(udec256!(217).quantize(udec256!(1e+2)), udec256!(2E+2));

See also:

Source

pub const fn trunc(self) -> Self

Truncates the decimal number to integral with no fractional portion.

This is a true truncation whereby no rounding is performed. This operation is equivalent to Self::rescale or Self::trunc_with_scale with scale set to 0.

§Performance

This operation is typically much faster than Self::rescale

§Panics:
§debug mode

This method will panic if truncate operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(3.141).trunc(), udec256!(3));
assert_eq!(udec256!(2.9).trunc(), udec256!(2));

let ctx = decimal::Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).trunc().is_nan());
assert!(UD256::NAN.with_ctx(ctx).trunc().is_nan());

See also:

Source

pub const fn trunc_with_scale(self, scale: i16) -> Self

Truncates the decimal number to the given number of digits after the decimal point.

This is a true truncation whereby no rounding is performed. This operation is equivalent to Self::rescale.

§Performance

This operation is typically much faster than Self::rescale

§Panics:
§debug mode

This method will panic if truncate operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(3.141592).trunc_with_scale(2), udec256!(3.14));
assert_eq!(udec256!(3.141592).trunc_with_scale(3), udec256!(3.141));
assert_eq!(udec256!(3.141592).trunc_with_scale(4), udec256!(3.1415));
assert_eq!(udec256!(3.141592).trunc_with_scale(5), udec256!(3.14159));
assert_eq!(udec256!(3.141592).trunc_with_scale(6), udec256!(3.141592));

let ctx = decimal::Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).trunc_with_scale(1).is_nan());
assert!(UD256::NAN.with_ctx(ctx).trunc_with_scale(1).is_nan());

See also:

Source

pub const fn is_ok(&self) -> bool

Returns:

Source

pub const fn ok(self) -> Option<Self>

Returns:

Source

pub fn to_scientific_notation(&self) -> String

Create a string of this unsigned decimal in scientific notation.

§Examples
use fastnum::udec256;

let n = udec256!(12345678);
assert_eq!(&n.to_scientific_notation(), "1.2345678e7");
Source

pub fn to_engineering_notation(&self) -> String

Create a string of this unsigned decimal in engineering notation.

Engineering notation is scientific notation with the exponent coerced to a multiple of three.

§Examples
use fastnum::udec256;

let n = udec256!(12345678);
assert_eq!(&n.to_engineering_notation(), "12.345678e6");
Source

pub const fn to_signed(self) -> Decimal<N>

Converts the given unsigned decimal to a signed decimal number.

§Examples
use fastnum::*;

let d = udec256!(1.2345);

assert_eq!(d.to_signed(), dec256!(1.2345));
Source

pub const fn try_from_signed(d: Decimal<N>) -> Result<Self, DecimalError>

Try converts from Decimal to UnsignedDecimal.

§Examples
use fastnum::*;

assert_eq!(UD256::try_from_signed(dec256!(1.2345)), Ok(udec256!(1.2345)));
assert!(UD256::try_from_signed(dec256!(-1.2345)).is_err());
Source

pub const fn transmute<const M: usize>(self) -> UnsignedDecimal<M>

👎Deprecated since 0.5.0

Deprecated, use resize instead.

Source

pub const fn resize<const M: usize>(self) -> UnsignedDecimal<M>

Safety resizes the underlying decimal to use M limbs while preserving the numeric value when possible.

This operation can either widen or narrow the internal representation:

  • Widening (M >= N) is lossless: the value is preserved.
  • Narrowing (M < N) may reduce available capacity. In this case the value is rounded according to the current Context and corresponding status flags are set.

Behavior details:

  • Rounding: extra precision is rounded using the active RoundingMode from the current context.
  • Signals: status flags such as Inexact, Rounded, Clamped, Overflow, or Underflow may be raised depending on the operation outcome and context limits.

Note: lossless, no-rounding conversions.

If you need to change width without any rounding:

  • Use crate::Cast for guaranteed-lossless widening (value-preserving by definition).

  • Use crate::TryCast for potential narrowing without rounding; it returns an error if the value does not fit into the target width, thus guaranteeing no silent rounding or truncation.

§Performance

This operation is typically much slower than crate::Cast and crate::TryCast transformations.

§Panics:
§debug mode

This method will panic if resize operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD64 is used here.

§Lossless widening:
use fastnum::*;

let x = udec64!(123.45);

// Increase internal width from 2 to 4 limbs — value is preserved.
let y: UD128 = x.resize();
assert_eq!(y, udec128!(123.45));
assert!(y.is_op_ok());
§Narrowing with possible rounding:
use fastnum::*;

let x = udec128!(1.8446744073709551616);

// Reduce width; value may be rounded according to context.
let y: UD64 = x.resize();
// Rounding/precision-loss indicators may be set, depending on capacity and context:
assert_eq!(y, udec64!(1.844674407370955162));
assert!(y.is_op_inexact() && y.is_op_rounded());

See also:

Trait Implementations§

Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i128) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i16) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i64) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i8) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: isize) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u128) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u16) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u64) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u8) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> AddAssign<f32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: f32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<f64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: f64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i128> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i128)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i16> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i16)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i8> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i8)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<isize> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: isize)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u128> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u128)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u16> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u16)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u8> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u8)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<usize> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: usize)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const N: usize, const M: usize> Cast<Decimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Widen,

Source§

fn cast(self) -> Decimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize> Cast<Decimal<N>> for UnsignedDecimal<N>

Source§

fn cast(self) -> Decimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize, const M: usize> Cast<UnsignedDecimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Widen,

Source§

fn cast(self) -> UnsignedDecimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize> Clone for UnsignedDecimal<N>

Source§

fn clone(&self) -> UnsignedDecimal<N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Default for UnsignedDecimal<N>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, const N: usize> Deserialize<'de> for UnsignedDecimal<N>

Source§

fn deserialize<D>(d: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<const N: usize> Display for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i128) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i16) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i64) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i8) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: isize) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u128) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: usize) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> DivAssign<f32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<f64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i128> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i128)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i16> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i16)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i8> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i8)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<isize> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: isize)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u128> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u128)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u16> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u16)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u8> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u8)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<usize> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: usize)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for Decimal<N>

Source§

fn from(ud: UnsignedDecimal<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for f32

Source§

fn from(d: UnsignedDecimal<N>) -> f32

Converts to this type from the input type.
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for f64

Source§

fn from(d: UnsignedDecimal<N>) -> f64

Converts to this type from the input type.
Source§

impl<const N: usize> From<u16> for UnsignedDecimal<N>

Source§

fn from(n: u16) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u32> for UnsignedDecimal<N>

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u64> for UnsignedDecimal<N>

Source§

fn from(n: u64) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u8> for UnsignedDecimal<N>

Source§

fn from(n: u8) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<usize> for UnsignedDecimal<N>

Source§

fn from(n: usize) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> FromStr for UnsignedDecimal<N>

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, ParseError>

Parses a string s to return a value of this type. Read more
Source§

impl<const N: usize> Hash for UnsignedDecimal<N>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> LowerExp for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i128) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i16) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i8) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: isize) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u128) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> MulAssign<f32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<f64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i128> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i128)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i16> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i16)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i8> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i8)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<isize> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: isize)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u128> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u128)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u16> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u16)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u8> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u8)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<usize> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: usize)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<const N: usize> Neg for UnsignedDecimal<N>

Source§

type Output = Decimal<N>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Decimal<N>

Performs the unary - operation. Read more
Source§

impl<const N: usize> Ord for UnsignedDecimal<N>

Source§

fn cmp(&self, rhs: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const N: usize> PartialEq for UnsignedDecimal<N>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
Source§

fn ne(&self, other: &Self) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialOrd for UnsignedDecimal<N>

Source§

fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f32) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f64) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i128) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i16) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i32) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i64) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i8) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: isize) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u128) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u16) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u64) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u8) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: usize) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> RemAssign<f32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: f32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<f64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: f64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i128> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i128)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i16> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i16)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i8> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i8)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<isize> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: isize)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u128> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u128)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u16> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u16)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u8> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u8)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<usize> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: usize)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl<const N: usize> Serialize for UnsignedDecimal<N>
where Self: Display,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i128) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i16) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i64) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i8) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: isize) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u128) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u16) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u64) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u8) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: usize) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> SubAssign<f32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: f32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<f64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: f64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i128> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i128)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i16> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i16)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i8> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i8)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<isize> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: isize)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u128> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u128)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u16> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u16)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u8> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u8)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<usize> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: usize)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<const N: usize> Sum for UnsignedDecimal<N>

Source§

fn sum<I: Iterator<Item = UnsignedDecimal<N>>>(iter: I) -> UnsignedDecimal<N>

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const N: usize, const M: usize> TryCast<Decimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Narrow,

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<Decimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for Decimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<UnsignedDecimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Narrow,

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<UnsignedDecimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize> TryFrom<Decimal<N>> for UnsignedDecimal<N>

Source§

type Error = DecimalError

The type returned in the event of a conversion error.
Source§

fn try_from(d: Decimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i128

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i16

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i32

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i64

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i8

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for isize

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u128

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u16

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u32

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u64

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u8

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for usize

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<f32> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<f64> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i128> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i16> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i32> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i64> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i8> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<isize> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<u128> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> UpperExp for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Copy for UnsignedDecimal<N>

Source§

impl<const N: usize> Eq for UnsignedDecimal<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for UnsignedDecimal<N>

§

impl<const N: usize> RefUnwindSafe for UnsignedDecimal<N>

§

impl<const N: usize> Send for UnsignedDecimal<N>

§

impl<const N: usize> Sync for UnsignedDecimal<N>

§

impl<const N: usize> Unpin for UnsignedDecimal<N>

§

impl<const N: usize> UnsafeUnpin for UnsignedDecimal<N>

§

impl<const N: usize> UnwindSafe for UnsignedDecimal<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,