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>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn from_usize(n: usize) -> Self
pub const fn from_usize(n: usize) -> Self
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn from_i8(int: i8) -> Result<Self, ParseError>
pub const fn from_i8(int: i8) -> Result<Self, ParseError>
Try converts i8 to UnsignedDecimal.
Sourcepub const fn from_i16(int: i16) -> Result<Self, ParseError>
pub const fn from_i16(int: i16) -> Result<Self, ParseError>
Try converts i16 to UnsignedDecimal.
Sourcepub const fn from_i32(int: i32) -> Result<Self, ParseError>
pub const fn from_i32(int: i32) -> Result<Self, ParseError>
Try converts i32 to UnsignedDecimal.
Sourcepub const fn from_i64(int: i64) -> Result<Self, ParseError>
pub const fn from_i64(int: i64) -> Result<Self, ParseError>
Try converts i64 to UnsignedDecimal.
Sourcepub const fn from_i128(int: i128) -> Result<Self, ParseError>
pub const fn from_i128(int: i128) -> Result<Self, ParseError>
Try converts i128 to UnsignedDecimal.
Sourcepub const fn from_isize(int: isize) -> Result<Self, ParseError>
pub const fn from_isize(int: isize) -> Result<Self, ParseError>
Try converts isize to UnsignedDecimal.
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn from_f32(n: f32) -> Result<Self, ParseError>
pub const fn from_f32(n: f32) -> Result<Self, ParseError>
Try converts f32 to UnsignedDecimal.
Sourcepub const fn from_f64(n: f64) -> Result<Self, ParseError>
pub const fn from_f64(n: f64) -> Result<Self, ParseError>
Try converts f64 to UnsignedDecimal.
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn to_u8(self) -> Result<u8, ParseError>
pub const fn to_u8(self) -> Result<u8, ParseError>
Try converts UnsignedDecimal into u8.
Sourcepub const fn to_u16(self) -> Result<u16, ParseError>
pub const fn to_u16(self) -> Result<u16, ParseError>
Try converts UnsignedDecimal into u16.
Sourcepub const fn to_u32(self) -> Result<u32, ParseError>
pub const fn to_u32(self) -> Result<u32, ParseError>
Try converts UnsignedDecimal into u32.
Sourcepub const fn to_u64(self) -> Result<u64, ParseError>
pub const fn to_u64(self) -> Result<u64, ParseError>
Try converts UnsignedDecimal into u64.
Sourcepub const fn to_u128(self) -> Result<u128, ParseError>
pub const fn to_u128(self) -> Result<u128, ParseError>
Try converts UnsignedDecimal into u128.
Sourcepub const fn to_usize(self) -> Result<usize, ParseError>
pub const fn to_usize(self) -> Result<usize, ParseError>
Try converts UnsignedDecimal into usize.
Sourcepub const fn to_i8(self) -> Result<i8, ParseError>
pub const fn to_i8(self) -> Result<i8, ParseError>
Try converts UnsignedDecimal into i8.
Sourcepub const fn to_i16(self) -> Result<i16, ParseError>
pub const fn to_i16(self) -> Result<i16, ParseError>
Try converts UnsignedDecimal into i16.
Sourcepub const fn to_i32(self) -> Result<i32, ParseError>
pub const fn to_i32(self) -> Result<i32, ParseError>
Try converts UnsignedDecimal into i32.
Sourcepub const fn to_i64(self) -> Result<i64, ParseError>
pub const fn to_i64(self) -> Result<i64, ParseError>
Try converts UnsignedDecimal into i64.
Sourcepub const fn to_i128(self) -> Result<i128, ParseError>
pub const fn to_i128(self) -> Result<i128, ParseError>
Try converts UnsignedDecimal into i128.
Sourcepub const fn to_isize(self) -> Result<isize, ParseError>
pub const fn to_isize(self) -> Result<isize, ParseError>
Try converts UnsignedDecimal into isize.
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn to_f32(self) -> f32
pub const fn to_f32(self) -> f32
Converts UnsignedDecimal into f32.
Sourcepub const fn to_f64(self) -> f64
pub const fn to_f64(self) -> f64
Converts UnsignedDecimal into f64.
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const MIN: Self = Self::ZERO
pub const MIN: Self = Self::ZERO
The smallest value that can be represented by this decimal type (0).
Sourcepub const MAX: Self
pub const MAX: Self
The largest value that can be represented by this decimal type (2N − 1)×1032’768.
Sourcepub const MIN_POSITIVE: Self
pub const MIN_POSITIVE: Self
The smallest positive, normalized value that this type can represent.
Sourcepub const EPSILON: Self
pub const EPSILON: Self
Machine epsilon value.
This is the difference between 1.0 and the next larger representable number.
Sourcepub const FRAC_2_SQRT_PI: Self
pub const FRAC_2_SQRT_PI: Self
2/sqrt(π).
Sourcepub const FRAC_1_SQRT_2: Self
pub const FRAC_1_SQRT_2: Self
1/sqrt(2).
Source§impl<const N: usize> UnsignedDecimal<N>
impl<const N: usize> UnsignedDecimal<N>
Sourcepub const fn from_parts(digits: UInt<N>, exp: i32, ctx: Context) -> Self
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));Sourcepub const fn from_str(s: &str, ctx: Context) -> Result<Self, ParseError>
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));Sourcepub const fn parse_str(s: &str, ctx: Context) -> Self
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());Sourcepub const fn digits(&self) -> UInt<N>
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));Sourcepub const fn digits_count(&self) -> usize
pub const fn digits_count(&self) -> usize
Returns the count of digits in the non-scaled integer representation
Sourcepub const fn fractional_digits_count(&self) -> i16
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);Sourcepub const fn is_zero(&self) -> bool
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());Sourcepub const fn is_op_div_by_zero(&self) -> bool
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.
Sourcepub const fn is_op_invalid(&self) -> bool
pub const fn is_op_invalid(&self) -> bool
Return true if the argument has Signals::OP_INVALID signal flag, and
false otherwise.
Sourcepub const fn is_op_subnormal(&self) -> bool
pub const fn is_op_subnormal(&self) -> bool
Return true if the argument has Signals::OP_SUBNORMAL signal flag,
and false otherwise.
Sourcepub const fn is_op_inexact(&self) -> bool
pub const fn is_op_inexact(&self) -> bool
Return true if the argument has Signals::OP_INEXACT signal flag, and
false otherwise.
Sourcepub const fn is_op_rounded(&self) -> bool
pub const fn is_op_rounded(&self) -> bool
Return true if the argument has Signals::OP_ROUNDED signal flag, and
false otherwise.
Sourcepub const fn is_op_clamped(&self) -> bool
pub const fn is_op_clamped(&self) -> bool
Return true if the argument has Signals::OP_CLAMPED signal flag, and
false otherwise.
Sourcepub const fn is_op_overflow(&self) -> bool
pub const fn is_op_overflow(&self) -> bool
Return true if the argument has Signals::OP_OVERFLOW signal flag,
and false otherwise.
Sourcepub const fn is_op_underflow(&self) -> bool
pub const fn is_op_underflow(&self) -> bool
Return true if the argument has Signals::OP_UNDERFLOW signal flag,
and false otherwise.
Sourcepub const fn is_op_ok(&self) -> bool
pub const fn is_op_ok(&self) -> bool
Return true if the argument has no signal flags, and false
otherwise.
Sourcepub const fn op_signals(&self) -> Signals
pub const fn op_signals(&self) -> Signals
Return the signaling block of given unsigned decimal.
Sourcepub const fn classify(&self) -> FpCategory
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);Sourcepub const fn is_normal(self) -> bool
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());Sourcepub const fn is_subnormal(self) -> bool
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());Sourcepub const fn is_infinite(self) -> bool
pub const fn is_infinite(self) -> bool
Sourcepub const fn with_ctx(self, ctx: Context) -> Self
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.,
INEXACTand 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
- the current value already has some signaling flags set (e.g.,
INEXACT) and the new Context enables traps for those signals; - or possible extra precision rounding operation performs with some Exceptional condition and the new Context enables traps for those Exceptional condition.
§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:
- More about
Decimal contextdecimals. - More about
Exceptional conditions. - Context
- RoundingMode
Sourcepub const fn with_rounding_mode(self, rm: RoundingMode) -> Self
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:
- More about
rounddecimals. - RoundingMode
Sourcepub const fn quantum(exp: i32, ctx: Context) -> Self
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));Sourcepub const fn reduce(self) -> Self
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);Sourcepub const fn neg(self) -> Decimal<N>
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));Sourcepub const fn eq(&self, other: &Self) -> bool
pub const fn eq(&self, other: &Self) -> bool
Tests for self and other values to be equal, and is used by ==
operator.
Sourcepub const fn ne(&self, other: &Self) -> bool
pub const fn ne(&self, other: &Self) -> bool
Tests for self and other values to be equal, and is used by ==
operator.
Sourcepub const fn max(self, other: Self) -> Self
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));Sourcepub const fn min(self, other: Self) -> Self
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));Sourcepub const fn clamp(self, min: Self, max: Self) -> Self
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));Sourcepub const fn lt(&self, other: &Self) -> bool
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);Sourcepub const fn le(&self, other: &Self) -> bool
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);Sourcepub const fn gt(&self, other: &Self) -> bool
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);Sourcepub const fn ge(&self, other: &Self) -> bool
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);Sourcepub const fn cmp(&self, other: &Self) -> Ordering
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);Sourcepub const fn add(self, rhs: Self) -> Self
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.
Sourcepub const fn sub(self, rhs: Self) -> Self
pub const fn sub(self, rhs: Self) -> Self
Calculates self – rhs.
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.
Sourcepub const fn mul(self, rhs: Self) -> Self
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.
Sourcepub const fn div(self, rhs: Self) -> Self
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.
Sourcepub const fn rem(self, rhs: Self) -> Self
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));Sourcepub const fn recip(self) -> Self
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));Sourcepub const fn pow(self, n: Decimal<N>) -> Self
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.
Sourcepub const fn powi(self, n: i32) -> Self
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.
Sourcepub const fn sqrt(self) -> Self
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.
Sourcepub const fn exp(self) -> Self
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.
Sourcepub const fn ln(self) -> Decimal<N>
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:
- More about the logarithm function.
Sourcepub const fn ln_1p(self) -> Decimal<N>
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:
- More about the logarithm function.
Sourcepub const fn log(self, base: Self) -> Decimal<N>
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:
- More about the logarithm function.
Sourcepub const fn log2(self) -> Decimal<N>
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:
- More about the logarithm function.
Sourcepub const fn log10(self) -> Decimal<N>
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:
- More about the logarithm function.
Sourcepub const fn mul_add(self, a: Self, b: Self) -> Self
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.
Sourcepub const fn round(self, digits: i16) -> Self
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:
- More about
rounddecimals. - RoundingMode.
Sourcepub const fn floor(self) -> Self
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));Sourcepub const fn ceil(self) -> Self
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));Sourcepub const fn rescale(self, new_scale: i16) -> Self
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:
- More about
rescaledecimals. - Self::quantize.
Sourcepub const fn quantize(self, other: Self) -> Self
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:
- More about
quantizedecimals. - Self::rescale.
Sourcepub const fn trunc(self) -> Self
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:
- More about
truncatedecimals. - Self::trunc_with_scale
- Self::rescale
- Self::quantize
Sourcepub const fn trunc_with_scale(self, scale: i16) -> Self
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:
- More about
truncatedecimals. - Self::trunc
- Self::rescale
- Self::quantize
Sourcepub const fn is_ok(&self) -> bool
pub const fn is_ok(&self) -> bool
Returns:
trueif no Exceptional condition Signals flag has been trapped by Context trap-enabler, andfalseotherwise.
Sourcepub const fn ok(self) -> Option<Self>
pub const fn ok(self) -> Option<Self>
Returns:
Some(Self)if no Exceptional condition Signals flag has been trapped by Context trap-enabler, andNoneotherwise.
Sourcepub fn to_scientific_notation(&self) -> String
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");Sourcepub fn to_engineering_notation(&self) -> String
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");Sourcepub const fn to_signed(self) -> Decimal<N>
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));Sourcepub const fn try_from_signed(d: Decimal<N>) -> Result<Self, DecimalError>
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());Sourcepub const fn transmute<const M: usize>(self) -> UnsignedDecimal<M>
👎Deprecated since 0.5.0
pub const fn transmute<const M: usize>(self) -> UnsignedDecimal<M>
Deprecated, use resize instead.
Sourcepub const fn resize<const M: usize>(self) -> UnsignedDecimal<M>
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 currentContextand corresponding status flags are set.
Behavior details:
- Rounding: extra precision is rounded using the active
RoundingModefrom the current context. - Signals: status flags such as
Inexact,Rounded,Clamped,Overflow, orUnderflowmay 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::Castfor guaranteed-lossless widening (value-preserving by definition). -
Use
crate::TryCastfor 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
impl<const N: usize> Add<UnsignedDecimal<N>> for f32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for f64
impl<const N: usize> Add<UnsignedDecimal<N>> for f64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for i128
impl<const N: usize> Add<UnsignedDecimal<N>> for i128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for i16
impl<const N: usize> Add<UnsignedDecimal<N>> for i16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for i32
impl<const N: usize> Add<UnsignedDecimal<N>> for i32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for i64
impl<const N: usize> Add<UnsignedDecimal<N>> for i64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for i8
impl<const N: usize> Add<UnsignedDecimal<N>> for i8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for isize
impl<const N: usize> Add<UnsignedDecimal<N>> for isize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for u128
impl<const N: usize> Add<UnsignedDecimal<N>> for u128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for u16
impl<const N: usize> Add<UnsignedDecimal<N>> for u16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for u32
impl<const N: usize> Add<UnsignedDecimal<N>> for u32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for u64
impl<const N: usize> Add<UnsignedDecimal<N>> for u64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for u8
impl<const N: usize> Add<UnsignedDecimal<N>> for u8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<UnsignedDecimal<N>> for usize
impl<const N: usize> Add<UnsignedDecimal<N>> for usize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<f32> for UnsignedDecimal<N>
impl<const N: usize> Add<f32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<f64> for UnsignedDecimal<N>
impl<const N: usize> Add<f64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<i128> for UnsignedDecimal<N>
impl<const N: usize> Add<i128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<i16> for UnsignedDecimal<N>
impl<const N: usize> Add<i16> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<i32> for UnsignedDecimal<N>
impl<const N: usize> Add<i32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<i64> for UnsignedDecimal<N>
impl<const N: usize> Add<i64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<i8> for UnsignedDecimal<N>
impl<const N: usize> Add<i8> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<isize> for UnsignedDecimal<N>
impl<const N: usize> Add<isize> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add<u128> for UnsignedDecimal<N>
impl<const N: usize> Add<u128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
+ operator.Source§impl<const N: usize> Add for UnsignedDecimal<N>
impl<const N: usize> Add for UnsignedDecimal<N>
Source§impl<const N: usize> AddAssign<f32> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<f32> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
+= operation. Read moreSource§impl<const N: usize> AddAssign<f64> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<f64> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
+= operation. Read moreSource§impl<const N: usize> AddAssign<i128> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<i128> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: i128)
fn add_assign(&mut self, rhs: i128)
+= operation. Read moreSource§impl<const N: usize> AddAssign<i16> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<i16> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: i16)
fn add_assign(&mut self, rhs: i16)
+= operation. Read moreSource§impl<const N: usize> AddAssign<i32> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<i32> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
+= operation. Read moreSource§impl<const N: usize> AddAssign<i64> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<i64> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: i64)
fn add_assign(&mut self, rhs: i64)
+= operation. Read moreSource§impl<const N: usize> AddAssign<i8> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<i8> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: i8)
fn add_assign(&mut self, rhs: i8)
+= operation. Read moreSource§impl<const N: usize> AddAssign<isize> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<isize> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: isize)
fn add_assign(&mut self, rhs: isize)
+= operation. Read moreSource§impl<const N: usize> AddAssign<u128> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<u128> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
+= operation. Read moreSource§impl<const N: usize> AddAssign<u16> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<u16> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
+= operation. Read moreSource§impl<const N: usize> AddAssign<u32> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<u32> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
+= operation. Read moreSource§impl<const N: usize> AddAssign<u64> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<u64> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
+= operation. Read moreSource§impl<const N: usize> AddAssign<u8> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<u8> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: u8)
fn add_assign(&mut self, rhs: u8)
+= operation. Read moreSource§impl<const N: usize> AddAssign<usize> for UnsignedDecimal<N>
impl<const N: usize> AddAssign<usize> for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
+= operation. Read moreSource§impl<const N: usize> AddAssign for UnsignedDecimal<N>
impl<const N: usize> AddAssign for UnsignedDecimal<N>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<const N: usize> AsExpression<Nullable<Numeric>> for &UnsignedDecimal<N>
impl<const N: usize> AsExpression<Nullable<Numeric>> for &UnsignedDecimal<N>
Source§type Expression = Bound<Nullable<Numeric>, &UnsignedDecimal<N>>
type Expression = Bound<Nullable<Numeric>, &UnsignedDecimal<N>>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl<const N: usize> AsExpression<Nullable<Numeric>> for UnsignedDecimal<N>
impl<const N: usize> AsExpression<Nullable<Numeric>> for UnsignedDecimal<N>
Source§type Expression = Bound<Nullable<Numeric>, UnsignedDecimal<N>>
type Expression = Bound<Nullable<Numeric>, UnsignedDecimal<N>>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl<const N: usize> AsExpression<Numeric> for &UnsignedDecimal<N>
impl<const N: usize> AsExpression<Numeric> for &UnsignedDecimal<N>
Source§type Expression = Bound<Numeric, &UnsignedDecimal<N>>
type Expression = Bound<Numeric, &UnsignedDecimal<N>>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl<const N: usize> AsExpression<Numeric> for UnsignedDecimal<N>
impl<const N: usize> AsExpression<Numeric> for UnsignedDecimal<N>
Source§type Expression = Bound<Numeric, UnsignedDecimal<N>>
type Expression = Bound<Numeric, UnsignedDecimal<N>>
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Source§impl<const N: usize, const M: usize> Cast<Decimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Widen,
impl<const N: usize, const M: usize> Cast<Decimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Widen,
Source§impl<const N: usize, const M: usize> Cast<UnsignedDecimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Widen,
impl<const N: usize, const M: usize> Cast<UnsignedDecimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Widen,
Source§fn cast(self) -> UnsignedDecimal<N>
fn cast(self) -> UnsignedDecimal<N>
Source§impl<const N: usize> Clone for UnsignedDecimal<N>
impl<const N: usize> Clone for UnsignedDecimal<N>
Source§fn clone(&self) -> UnsignedDecimal<N>
fn clone(&self) -> UnsignedDecimal<N>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const N: usize> ComposeSchema for UnsignedDecimal<N>
impl<const N: usize> ComposeSchema for UnsignedDecimal<N>
Source§impl<const N: usize> ConstOne for UnsignedDecimal<N>
impl<const N: usize> ConstOne for UnsignedDecimal<N>
Source§impl<const N: usize> ConstZero for UnsignedDecimal<N>
impl<const N: usize> ConstZero for UnsignedDecimal<N>
Source§impl<const N: usize> Debug for UnsignedDecimal<N>
impl<const N: usize> Debug for UnsignedDecimal<N>
Source§impl<const N: usize> Decode<'_, Postgres> for UnsignedDecimal<N>
impl<const N: usize> Decode<'_, Postgres> for UnsignedDecimal<N>
Source§fn decode(value: PgValueRef<'_>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'_>) -> Result<Self, BoxDynError>
Source§impl<const N: usize> Default for UnsignedDecimal<N>
impl<const N: usize> Default for UnsignedDecimal<N>
Source§impl<'de, const N: usize> Deserialize<'de> for UnsignedDecimal<N>
impl<'de, const N: usize> Deserialize<'de> for UnsignedDecimal<N>
Source§fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<const N: usize> Display for UnsignedDecimal<N>
impl<const N: usize> Display for UnsignedDecimal<N>
Source§impl<const N: usize> Div<UnsignedDecimal<N>> for f32
impl<const N: usize> Div<UnsignedDecimal<N>> for f32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for f64
impl<const N: usize> Div<UnsignedDecimal<N>> for f64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for i128
impl<const N: usize> Div<UnsignedDecimal<N>> for i128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for i16
impl<const N: usize> Div<UnsignedDecimal<N>> for i16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for i32
impl<const N: usize> Div<UnsignedDecimal<N>> for i32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for i64
impl<const N: usize> Div<UnsignedDecimal<N>> for i64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for i8
impl<const N: usize> Div<UnsignedDecimal<N>> for i8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for isize
impl<const N: usize> Div<UnsignedDecimal<N>> for isize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for u128
impl<const N: usize> Div<UnsignedDecimal<N>> for u128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for u16
impl<const N: usize> Div<UnsignedDecimal<N>> for u16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for u32
impl<const N: usize> Div<UnsignedDecimal<N>> for u32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for u64
impl<const N: usize> Div<UnsignedDecimal<N>> for u64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for u8
impl<const N: usize> Div<UnsignedDecimal<N>> for u8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<UnsignedDecimal<N>> for usize
impl<const N: usize> Div<UnsignedDecimal<N>> for usize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<f32> for UnsignedDecimal<N>
impl<const N: usize> Div<f32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<f64> for UnsignedDecimal<N>
impl<const N: usize> Div<f64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<i128> for UnsignedDecimal<N>
impl<const N: usize> Div<i128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<i16> for UnsignedDecimal<N>
impl<const N: usize> Div<i16> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<i32> for UnsignedDecimal<N>
impl<const N: usize> Div<i32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<i64> for UnsignedDecimal<N>
impl<const N: usize> Div<i64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<i8> for UnsignedDecimal<N>
impl<const N: usize> Div<i8> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<isize> for UnsignedDecimal<N>
impl<const N: usize> Div<isize> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div<u128> for UnsignedDecimal<N>
impl<const N: usize> Div<u128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
/ operator.Source§impl<const N: usize> Div for UnsignedDecimal<N>
impl<const N: usize> Div for UnsignedDecimal<N>
Source§impl<const N: usize> DivAssign<f32> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<f32> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/= operation. Read moreSource§impl<const N: usize> DivAssign<f64> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<f64> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/= operation. Read moreSource§impl<const N: usize> DivAssign<i128> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<i128> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: i128)
fn div_assign(&mut self, rhs: i128)
/= operation. Read moreSource§impl<const N: usize> DivAssign<i16> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<i16> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: i16)
fn div_assign(&mut self, rhs: i16)
/= operation. Read moreSource§impl<const N: usize> DivAssign<i32> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<i32> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
/= operation. Read moreSource§impl<const N: usize> DivAssign<i64> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<i64> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/= operation. Read moreSource§impl<const N: usize> DivAssign<i8> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<i8> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: i8)
fn div_assign(&mut self, rhs: i8)
/= operation. Read moreSource§impl<const N: usize> DivAssign<isize> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<isize> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: isize)
fn div_assign(&mut self, rhs: isize)
/= operation. Read moreSource§impl<const N: usize> DivAssign<u128> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<u128> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: u128)
fn div_assign(&mut self, rhs: u128)
/= operation. Read moreSource§impl<const N: usize> DivAssign<u16> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<u16> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: u16)
fn div_assign(&mut self, rhs: u16)
/= operation. Read moreSource§impl<const N: usize> DivAssign<u32> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<u32> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/= operation. Read moreSource§impl<const N: usize> DivAssign<u64> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<u64> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/= operation. Read moreSource§impl<const N: usize> DivAssign<u8> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<u8> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: u8)
fn div_assign(&mut self, rhs: u8)
/= operation. Read moreSource§impl<const N: usize> DivAssign<usize> for UnsignedDecimal<N>
impl<const N: usize> DivAssign<usize> for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: usize)
fn div_assign(&mut self, rhs: usize)
/= operation. Read moreSource§impl<const N: usize> DivAssign for UnsignedDecimal<N>
impl<const N: usize> DivAssign for UnsignedDecimal<N>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<const N: usize> Encode<'_, Postgres> for UnsignedDecimal<N>
impl<const N: usize> Encode<'_, Postgres> for UnsignedDecimal<N>
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl<const N: usize> FloatConst for UnsignedDecimal<N>
impl<const N: usize> FloatConst for UnsignedDecimal<N>
Source§fn FRAC_1_SQRT_2() -> Self
fn FRAC_1_SQRT_2() -> Self
1.0 / sqrt(2.0).Source§fn FRAC_2_SQRT_PI() -> Self
fn FRAC_2_SQRT_PI() -> Self
2.0 / sqrt(π).Source§impl<const N: usize> From<UnsignedDecimal<N>> for Decimal<N>
impl<const N: usize> From<UnsignedDecimal<N>> for Decimal<N>
Source§fn from(ud: UnsignedDecimal<N>) -> Self
fn from(ud: UnsignedDecimal<N>) -> Self
Source§impl<const N: usize> From<UnsignedDecimal<N>> for f32
impl<const N: usize> From<UnsignedDecimal<N>> for f32
Source§fn from(d: UnsignedDecimal<N>) -> f32
fn from(d: UnsignedDecimal<N>) -> f32
Source§impl<const N: usize> From<UnsignedDecimal<N>> for f64
impl<const N: usize> From<UnsignedDecimal<N>> for f64
Source§fn from(d: UnsignedDecimal<N>) -> f64
fn from(d: UnsignedDecimal<N>) -> f64
Source§impl<const N: usize> FromPrimitive for UnsignedDecimal<N>
impl<const N: usize> FromPrimitive for UnsignedDecimal<N>
Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl<'a, const N: usize> FromSql<'a> for UnsignedDecimal<N>
impl<'a, const N: usize> FromSql<'a> for UnsignedDecimal<N>
Source§fn from_sql(
_: &Type,
raw: &'a [u8],
) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql( _: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Sync + Send>>
Type in its binary format. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type.Source§impl<const N: usize> FromStr for UnsignedDecimal<N>
impl<const N: usize> FromStr for UnsignedDecimal<N>
Source§impl<const N: usize> Hash for UnsignedDecimal<N>
impl<const N: usize> Hash for UnsignedDecimal<N>
Source§impl<const N: usize> LowerExp for UnsignedDecimal<N>
impl<const N: usize> LowerExp for UnsignedDecimal<N>
Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for f32
impl<const N: usize> Mul<UnsignedDecimal<N>> for f32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for f64
impl<const N: usize> Mul<UnsignedDecimal<N>> for f64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for i128
impl<const N: usize> Mul<UnsignedDecimal<N>> for i128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for i16
impl<const N: usize> Mul<UnsignedDecimal<N>> for i16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for i32
impl<const N: usize> Mul<UnsignedDecimal<N>> for i32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for i64
impl<const N: usize> Mul<UnsignedDecimal<N>> for i64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for i8
impl<const N: usize> Mul<UnsignedDecimal<N>> for i8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for isize
impl<const N: usize> Mul<UnsignedDecimal<N>> for isize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for u128
impl<const N: usize> Mul<UnsignedDecimal<N>> for u128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for u16
impl<const N: usize> Mul<UnsignedDecimal<N>> for u16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for u32
impl<const N: usize> Mul<UnsignedDecimal<N>> for u32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for u64
impl<const N: usize> Mul<UnsignedDecimal<N>> for u64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for u8
impl<const N: usize> Mul<UnsignedDecimal<N>> for u8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<UnsignedDecimal<N>> for usize
impl<const N: usize> Mul<UnsignedDecimal<N>> for usize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<f32> for UnsignedDecimal<N>
impl<const N: usize> Mul<f32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<f64> for UnsignedDecimal<N>
impl<const N: usize> Mul<f64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<i128> for UnsignedDecimal<N>
impl<const N: usize> Mul<i128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<i16> for UnsignedDecimal<N>
impl<const N: usize> Mul<i16> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<i32> for UnsignedDecimal<N>
impl<const N: usize> Mul<i32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<i64> for UnsignedDecimal<N>
impl<const N: usize> Mul<i64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<i8> for UnsignedDecimal<N>
impl<const N: usize> Mul<i8> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<isize> for UnsignedDecimal<N>
impl<const N: usize> Mul<isize> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul<u128> for UnsignedDecimal<N>
impl<const N: usize> Mul<u128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
* operator.Source§impl<const N: usize> Mul for UnsignedDecimal<N>
impl<const N: usize> Mul for UnsignedDecimal<N>
Source§impl<const N: usize> MulAssign<f32> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<f32> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*= operation. Read moreSource§impl<const N: usize> MulAssign<f64> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<f64> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*= operation. Read moreSource§impl<const N: usize> MulAssign<i128> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<i128> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: i128)
fn mul_assign(&mut self, rhs: i128)
*= operation. Read moreSource§impl<const N: usize> MulAssign<i16> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<i16> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: i16)
fn mul_assign(&mut self, rhs: i16)
*= operation. Read moreSource§impl<const N: usize> MulAssign<i32> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<i32> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
*= operation. Read moreSource§impl<const N: usize> MulAssign<i64> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<i64> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*= operation. Read moreSource§impl<const N: usize> MulAssign<i8> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<i8> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: i8)
fn mul_assign(&mut self, rhs: i8)
*= operation. Read moreSource§impl<const N: usize> MulAssign<isize> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<isize> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: isize)
fn mul_assign(&mut self, rhs: isize)
*= operation. Read moreSource§impl<const N: usize> MulAssign<u128> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<u128> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: u128)
fn mul_assign(&mut self, rhs: u128)
*= operation. Read moreSource§impl<const N: usize> MulAssign<u16> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<u16> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
*= operation. Read moreSource§impl<const N: usize> MulAssign<u32> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<u32> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*= operation. Read moreSource§impl<const N: usize> MulAssign<u64> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<u64> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*= operation. Read moreSource§impl<const N: usize> MulAssign<u8> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<u8> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: u8)
fn mul_assign(&mut self, rhs: u8)
*= operation. Read moreSource§impl<const N: usize> MulAssign<usize> for UnsignedDecimal<N>
impl<const N: usize> MulAssign<usize> for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: usize)
fn mul_assign(&mut self, rhs: usize)
*= operation. Read moreSource§impl<const N: usize> MulAssign for UnsignedDecimal<N>
impl<const N: usize> MulAssign for UnsignedDecimal<N>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<const N: usize> Neg for UnsignedDecimal<N>
impl<const N: usize> Neg for UnsignedDecimal<N>
Source§impl<const N: usize> Num for UnsignedDecimal<N>
impl<const N: usize> Num for UnsignedDecimal<N>
type FromStrRadixErr = ParseError
Source§fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
2..=36). Read moreSource§impl<const N: usize> One for UnsignedDecimal<N>
impl<const N: usize> One for UnsignedDecimal<N>
Source§impl<const N: usize> Ord for UnsignedDecimal<N>
impl<const N: usize> Ord for UnsignedDecimal<N>
Source§impl<const N: usize> PartialEq for UnsignedDecimal<N>
impl<const N: usize> PartialEq for UnsignedDecimal<N>
Source§impl<const N: usize> PartialOrd for UnsignedDecimal<N>
impl<const N: usize> PartialOrd for UnsignedDecimal<N>
Source§impl<const N: usize> PgHasArrayType for UnsignedDecimal<N>
impl<const N: usize> PgHasArrayType for UnsignedDecimal<N>
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl<DB, ST, const N: usize> Queryable<ST, DB> for UnsignedDecimal<N>
impl<DB, ST, const N: usize> Queryable<ST, DB> for UnsignedDecimal<N>
Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for f32
impl<const N: usize> Rem<UnsignedDecimal<N>> for f32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for f64
impl<const N: usize> Rem<UnsignedDecimal<N>> for f64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for i128
impl<const N: usize> Rem<UnsignedDecimal<N>> for i128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for i16
impl<const N: usize> Rem<UnsignedDecimal<N>> for i16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for i32
impl<const N: usize> Rem<UnsignedDecimal<N>> for i32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for i64
impl<const N: usize> Rem<UnsignedDecimal<N>> for i64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for i8
impl<const N: usize> Rem<UnsignedDecimal<N>> for i8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for isize
impl<const N: usize> Rem<UnsignedDecimal<N>> for isize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for u128
impl<const N: usize> Rem<UnsignedDecimal<N>> for u128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for u16
impl<const N: usize> Rem<UnsignedDecimal<N>> for u16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for u32
impl<const N: usize> Rem<UnsignedDecimal<N>> for u32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for u64
impl<const N: usize> Rem<UnsignedDecimal<N>> for u64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for u8
impl<const N: usize> Rem<UnsignedDecimal<N>> for u8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<UnsignedDecimal<N>> for usize
impl<const N: usize> Rem<UnsignedDecimal<N>> for usize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<f32> for UnsignedDecimal<N>
impl<const N: usize> Rem<f32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<f64> for UnsignedDecimal<N>
impl<const N: usize> Rem<f64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<i128> for UnsignedDecimal<N>
impl<const N: usize> Rem<i128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<i16> for UnsignedDecimal<N>
impl<const N: usize> Rem<i16> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<i32> for UnsignedDecimal<N>
impl<const N: usize> Rem<i32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<i64> for UnsignedDecimal<N>
impl<const N: usize> Rem<i64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<i8> for UnsignedDecimal<N>
impl<const N: usize> Rem<i8> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<isize> for UnsignedDecimal<N>
impl<const N: usize> Rem<isize> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem<u128> for UnsignedDecimal<N>
impl<const N: usize> Rem<u128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
% operator.Source§impl<const N: usize> Rem for UnsignedDecimal<N>
impl<const N: usize> Rem for UnsignedDecimal<N>
Source§impl<const N: usize> RemAssign<f32> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<f32> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: f32)
fn rem_assign(&mut self, rhs: f32)
%= operation. Read moreSource§impl<const N: usize> RemAssign<f64> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<f64> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: f64)
fn rem_assign(&mut self, rhs: f64)
%= operation. Read moreSource§impl<const N: usize> RemAssign<i128> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<i128> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: i128)
fn rem_assign(&mut self, rhs: i128)
%= operation. Read moreSource§impl<const N: usize> RemAssign<i16> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<i16> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: i16)
fn rem_assign(&mut self, rhs: i16)
%= operation. Read moreSource§impl<const N: usize> RemAssign<i32> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<i32> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: i32)
fn rem_assign(&mut self, rhs: i32)
%= operation. Read moreSource§impl<const N: usize> RemAssign<i64> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<i64> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
%= operation. Read moreSource§impl<const N: usize> RemAssign<i8> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<i8> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: i8)
fn rem_assign(&mut self, rhs: i8)
%= operation. Read moreSource§impl<const N: usize> RemAssign<isize> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<isize> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: isize)
fn rem_assign(&mut self, rhs: isize)
%= operation. Read moreSource§impl<const N: usize> RemAssign<u128> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<u128> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: u128)
fn rem_assign(&mut self, rhs: u128)
%= operation. Read moreSource§impl<const N: usize> RemAssign<u16> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<u16> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: u16)
fn rem_assign(&mut self, rhs: u16)
%= operation. Read moreSource§impl<const N: usize> RemAssign<u32> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<u32> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: u32)
fn rem_assign(&mut self, rhs: u32)
%= operation. Read moreSource§impl<const N: usize> RemAssign<u64> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<u64> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%= operation. Read moreSource§impl<const N: usize> RemAssign<u8> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<u8> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: u8)
fn rem_assign(&mut self, rhs: u8)
%= operation. Read moreSource§impl<const N: usize> RemAssign<usize> for UnsignedDecimal<N>
impl<const N: usize> RemAssign<usize> for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: usize)
fn rem_assign(&mut self, rhs: usize)
%= operation. Read moreSource§impl<const N: usize> RemAssign for UnsignedDecimal<N>
impl<const N: usize> RemAssign for UnsignedDecimal<N>
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read moreSource§impl<const N: usize> Sub<UnsignedDecimal<N>> for f32
impl<const N: usize> Sub<UnsignedDecimal<N>> for f32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for f64
impl<const N: usize> Sub<UnsignedDecimal<N>> for f64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for i128
impl<const N: usize> Sub<UnsignedDecimal<N>> for i128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for i16
impl<const N: usize> Sub<UnsignedDecimal<N>> for i16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for i32
impl<const N: usize> Sub<UnsignedDecimal<N>> for i32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for i64
impl<const N: usize> Sub<UnsignedDecimal<N>> for i64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for i8
impl<const N: usize> Sub<UnsignedDecimal<N>> for i8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for isize
impl<const N: usize> Sub<UnsignedDecimal<N>> for isize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for u128
impl<const N: usize> Sub<UnsignedDecimal<N>> for u128
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for u16
impl<const N: usize> Sub<UnsignedDecimal<N>> for u16
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for u32
impl<const N: usize> Sub<UnsignedDecimal<N>> for u32
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for u64
impl<const N: usize> Sub<UnsignedDecimal<N>> for u64
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for u8
impl<const N: usize> Sub<UnsignedDecimal<N>> for u8
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<UnsignedDecimal<N>> for usize
impl<const N: usize> Sub<UnsignedDecimal<N>> for usize
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<f32> for UnsignedDecimal<N>
impl<const N: usize> Sub<f32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<f64> for UnsignedDecimal<N>
impl<const N: usize> Sub<f64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<i128> for UnsignedDecimal<N>
impl<const N: usize> Sub<i128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<i16> for UnsignedDecimal<N>
impl<const N: usize> Sub<i16> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<i32> for UnsignedDecimal<N>
impl<const N: usize> Sub<i32> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<i64> for UnsignedDecimal<N>
impl<const N: usize> Sub<i64> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<i8> for UnsignedDecimal<N>
impl<const N: usize> Sub<i8> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<isize> for UnsignedDecimal<N>
impl<const N: usize> Sub<isize> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub<u128> for UnsignedDecimal<N>
impl<const N: usize> Sub<u128> for UnsignedDecimal<N>
Source§type Output = UnsignedDecimal<N>
type Output = UnsignedDecimal<N>
- operator.Source§impl<const N: usize> Sub for UnsignedDecimal<N>
impl<const N: usize> Sub for UnsignedDecimal<N>
Source§impl<const N: usize> SubAssign<f32> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<f32> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
-= operation. Read moreSource§impl<const N: usize> SubAssign<f64> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<f64> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: f64)
fn sub_assign(&mut self, rhs: f64)
-= operation. Read moreSource§impl<const N: usize> SubAssign<i128> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<i128> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: i128)
fn sub_assign(&mut self, rhs: i128)
-= operation. Read moreSource§impl<const N: usize> SubAssign<i16> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<i16> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: i16)
fn sub_assign(&mut self, rhs: i16)
-= operation. Read moreSource§impl<const N: usize> SubAssign<i32> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<i32> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
-= operation. Read moreSource§impl<const N: usize> SubAssign<i64> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<i64> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: i64)
fn sub_assign(&mut self, rhs: i64)
-= operation. Read moreSource§impl<const N: usize> SubAssign<i8> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<i8> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: i8)
fn sub_assign(&mut self, rhs: i8)
-= operation. Read moreSource§impl<const N: usize> SubAssign<isize> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<isize> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: isize)
fn sub_assign(&mut self, rhs: isize)
-= operation. Read moreSource§impl<const N: usize> SubAssign<u128> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<u128> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
-= operation. Read moreSource§impl<const N: usize> SubAssign<u16> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<u16> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: u16)
fn sub_assign(&mut self, rhs: u16)
-= operation. Read moreSource§impl<const N: usize> SubAssign<u32> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<u32> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: u32)
fn sub_assign(&mut self, rhs: u32)
-= operation. Read moreSource§impl<const N: usize> SubAssign<u64> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<u64> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
-= operation. Read moreSource§impl<const N: usize> SubAssign<u8> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<u8> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: u8)
fn sub_assign(&mut self, rhs: u8)
-= operation. Read moreSource§impl<const N: usize> SubAssign<usize> for UnsignedDecimal<N>
impl<const N: usize> SubAssign<usize> for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
-= operation. Read moreSource§impl<const N: usize> SubAssign for UnsignedDecimal<N>
impl<const N: usize> SubAssign for UnsignedDecimal<N>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl<const N: usize> Sum for UnsignedDecimal<N>
impl<const N: usize> Sum for UnsignedDecimal<N>
Source§fn sum<I: Iterator<Item = UnsignedDecimal<N>>>(iter: I) -> UnsignedDecimal<N>
fn sum<I: Iterator<Item = UnsignedDecimal<N>>>(iter: I) -> UnsignedDecimal<N>
Self from the elements by “summing up”
the items.Source§impl<const N: usize> ToPrimitive for UnsignedDecimal<N>
impl<const N: usize> ToPrimitive for UnsignedDecimal<N>
Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self to an i64. If the value cannot be
represented by an i64, then None is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self to a u32. If the value cannot be
represented by a u32, then None is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self to a u128. If the value cannot be
represented by a u128 (u64 under the default implementation), then
None is returned. Read moreSource§impl<const N: usize> ToSchema for UnsignedDecimal<N>
impl<const N: usize> ToSchema for UnsignedDecimal<N>
Source§impl<const N: usize> ToSql for UnsignedDecimal<N>
impl<const N: usize> ToSql for UnsignedDecimal<N>
Source§fn to_sql(
&self,
_: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn to_sql(
&self,
_: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
self into the binary format of the specified
Postgres Type, appending it to out. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type.Source§fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Source§fn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Source§impl<const N: usize, const M: usize> TryCast<Decimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Narrow,
impl<const N: usize, const M: usize> TryCast<Decimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Narrow,
Source§impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Narrow,
impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for UnsignedDecimal<N>where
Dimension<N, M>: Narrow,
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i128
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i128
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i16
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i16
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i32
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i32
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i64
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i64
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i8
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i8
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for isize
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for isize
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u128
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u128
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u16
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u16
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u32
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u32
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u64
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u64
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u8
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u8
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> TryFrom<UnsignedDecimal<N>> for usize
impl<const N: usize> TryFrom<UnsignedDecimal<N>> for usize
Source§type Error = ParseError
type Error = ParseError
Source§impl<const N: usize> UpperExp for UnsignedDecimal<N>
impl<const N: usize> UpperExp for UnsignedDecimal<N>
Source§impl<const N: usize> Zero for UnsignedDecimal<N>
impl<const N: usize> Zero for UnsignedDecimal<N>
impl<const N: usize> Copy for UnsignedDecimal<N>
impl<const N: usize> DefaultIsZeroes for UnsignedDecimal<N>
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> UnwindSafe for UnsignedDecimal<N>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
Source§fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
self as a ToSql trait object.§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<I> FromRadix10 for I
impl<I> FromRadix10 for I
Source§impl<I> FromRadix10Signed for I
impl<I> FromRadix10Signed for I
Source§impl<I> FromRadix16 for I
impl<I> FromRadix16 for I
Source§impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
Source§impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more