Struct cosmwasm_std::SignedDecimal256
source · pub struct SignedDecimal256(/* private fields */);
Expand description
A signed fixed-point decimal value with 18 fractional digits, i.e. SignedDecimal256(1_000_000_000_000_000_000) == 1.0
The greatest possible value that can be represented is 57896044618658097711785492504343953926634992332820282019728.792003956564819967 (which is (2^255 - 1) / 10^18) and the smallest is -57896044618658097711785492504343953926634992332820282019728.792003956564819968 (which is -2^255 / 10^18).
Implementations§
source§impl SignedDecimal256
impl SignedDecimal256
sourcepub const DECIMAL_PLACES: u32 = 18u32
pub const DECIMAL_PLACES: u32 = 18u32
The number of decimal places. Since decimal types are fixed-point rather than floating-point, this is a constant.
sourcepub const MAX: Self = _
pub const MAX: Self = _
The largest value that can be represented by this signed decimal type.
Examples
assert_eq!(
SignedDecimal256::MAX.to_string(),
"57896044618658097711785492504343953926634992332820282019728.792003956564819967"
);
sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest value that can be represented by this signed decimal type.
Examples
assert_eq!(
SignedDecimal256::MIN.to_string(),
"-57896044618658097711785492504343953926634992332820282019728.792003956564819968"
);
sourcepub const fn new(value: Int256) -> Self
pub const fn new(value: Int256) -> Self
Creates a SignedDecimal256(value)
This is equivalent to SignedDecimal256::from_atomics(value, 18)
but usable in a const context.
Examples
assert_eq!(SignedDecimal256::new(Int256::one()).to_string(), "0.000000000000000001");
sourcepub const fn raw(value: i128) -> Self
pub const fn raw(value: i128) -> Self
Creates a SignedDecimal256(Int256(value))
This is equivalent to SignedDecimal256::from_atomics(value, 18)
but usable in a const context.
Examples
assert_eq!(SignedDecimal256::raw(1234i128).to_string(), "0.000000000000001234");
sourcepub const fn negative_one() -> Self
pub const fn negative_one() -> Self
Create a -1.0 SignedDecimal256
sourcepub fn from_atomics(
atomics: impl Into<Int256>,
decimal_places: u32
) -> Result<Self, SignedDecimal256RangeExceeded>
pub fn from_atomics( atomics: impl Into<Int256>, decimal_places: u32 ) -> Result<Self, SignedDecimal256RangeExceeded>
Creates a signed decimal from a number of atomic units and the number of decimal places. The inputs will be converted internally to form a signed decimal with 18 decimal places. So the input 123 and 2 will create the decimal 1.23.
Using 18 decimal places is slightly more efficient than other values as no internal conversion is necessary.
Examples
let a = SignedDecimal256::from_atomics(Int256::from(1234), 3).unwrap();
assert_eq!(a.to_string(), "1.234");
let a = SignedDecimal256::from_atomics(1234i128, 0).unwrap();
assert_eq!(a.to_string(), "1234");
let a = SignedDecimal256::from_atomics(1i64, 18).unwrap();
assert_eq!(a.to_string(), "0.000000000000000001");
let a = SignedDecimal256::from_atomics(-1i64, 18).unwrap();
assert_eq!(a.to_string(), "-0.000000000000000001");
sourcepub fn from_ratio(
numerator: impl Into<Int256>,
denominator: impl Into<Int256>
) -> Self
pub fn from_ratio( numerator: impl Into<Int256>, denominator: impl Into<Int256> ) -> Self
Returns the ratio (numerator / denominator) as a SignedDecimal256
Examples
assert_eq!(
SignedDecimal256::from_ratio(1, 3).to_string(),
"0.333333333333333333"
);
sourcepub fn checked_from_ratio(
numerator: impl Into<Int256>,
denominator: impl Into<Int256>
) -> Result<Self, CheckedFromRatioError>
pub fn checked_from_ratio( numerator: impl Into<Int256>, denominator: impl Into<Int256> ) -> Result<Self, CheckedFromRatioError>
Returns the ratio (numerator / denominator) as a SignedDecimal256
Examples
assert_eq!(
SignedDecimal256::checked_from_ratio(1, 3).unwrap().to_string(),
"0.333333333333333333"
);
assert_eq!(
SignedDecimal256::checked_from_ratio(1, 0),
Err(CheckedFromRatioError::DivideByZero)
);
sourcepub const fn is_negative(&self) -> bool
pub const fn is_negative(&self) -> bool
Returns true
if the number is negative (< 0)
sourcepub const fn atomics(&self) -> Int256
pub const fn atomics(&self) -> Int256
A decimal is an integer of atomic units plus a number that specifies the position of the decimal dot. So any decimal can be expressed as two numbers.
Examples
// Value with whole and fractional part
let a = SignedDecimal256::from_str("1.234").unwrap();
assert_eq!(a.decimal_places(), 18);
assert_eq!(a.atomics(), Int256::from(1234000000000000000i128));
// Smallest possible value
let b = SignedDecimal256::from_str("0.000000000000000001").unwrap();
assert_eq!(b.decimal_places(), 18);
assert_eq!(b.atomics(), Int256::from(1));
sourcepub const fn decimal_places(&self) -> u32
pub const fn decimal_places(&self) -> u32
The number of decimal places. This is a constant value for now but this could potentially change as the type evolves.
See also SignedDecimal256::atomics()
.
sourcepub fn trunc(&self) -> Self
pub fn trunc(&self) -> Self
Rounds value by truncating the decimal places.
Examples
assert!(SignedDecimal256::from_str("0.6").unwrap().trunc().is_zero());
assert_eq!(SignedDecimal256::from_str("-5.8").unwrap().trunc().to_string(), "-5");
sourcepub fn floor(&self) -> Self
pub fn floor(&self) -> Self
Rounds value down after decimal places. Panics on overflow.
Examples
assert!(SignedDecimal256::from_str("0.6").unwrap().floor().is_zero());
assert_eq!(SignedDecimal256::from_str("-5.2").unwrap().floor().to_string(), "-6");
sourcepub fn checked_floor(&self) -> Result<Self, RoundDownOverflowError>
pub fn checked_floor(&self) -> Result<Self, RoundDownOverflowError>
Rounds value down after decimal places.
sourcepub fn ceil(&self) -> Self
pub fn ceil(&self) -> Self
Rounds value up after decimal places. Panics on overflow.
Examples
assert_eq!(SignedDecimal256::from_str("0.2").unwrap().ceil(), SignedDecimal256::one());
assert_eq!(SignedDecimal256::from_str("-5.8").unwrap().ceil().to_string(), "-5");
sourcepub fn checked_ceil(&self) -> Result<Self, RoundUpOverflowError>
pub fn checked_ceil(&self) -> Result<Self, RoundUpOverflowError>
Rounds value up after decimal places. Returns OverflowError on overflow.
sourcepub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
Computes self + other
, returning an OverflowError
if an overflow occurred.
sourcepub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
Computes self - other
, returning an OverflowError
if an overflow occurred.
sourcepub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
Multiplies one SignedDecimal256
by another, returning an OverflowError
if an overflow occurred.
sourcepub fn pow(self, exp: u32) -> Self
pub fn pow(self, exp: u32) -> Self
Raises a value to the power of exp
, panics if an overflow occurred.
sourcepub fn checked_pow(self, exp: u32) -> Result<Self, OverflowError>
pub fn checked_pow(self, exp: u32) -> Result<Self, OverflowError>
Raises a value to the power of exp
, returning an OverflowError
if an overflow occurred.
pub fn checked_div(self, other: Self) -> Result<Self, CheckedFromRatioError>
sourcepub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>
pub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>
Computes self % other
, returning an DivideByZeroError
if other == 0
.
pub const fn abs_diff(self, other: Self) -> Decimal256
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_mul(self, other: Self) -> Self
pub fn saturating_pow(self, exp: u32) -> Self
sourcepub fn to_int_floor(self) -> Int256
pub fn to_int_floor(self) -> Int256
Converts this decimal to a signed integer by rounding down to the next integer, e.g. 22.5 becomes 22 and -1.2 becomes -2.
Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal256, Int256};
let d = SignedDecimal256::from_str("12.345").unwrap();
assert_eq!(d.to_int_floor(), Int256::from(12));
let d = SignedDecimal256::from_str("-12.999").unwrap();
assert_eq!(d.to_int_floor(), Int256::from(-13));
let d = SignedDecimal256::from_str("-0.05").unwrap();
assert_eq!(d.to_int_floor(), Int256::from(-1));
sourcepub fn to_int_trunc(self) -> Int256
pub fn to_int_trunc(self) -> Int256
Converts this decimal to a signed integer by truncating the fractional part, e.g. 22.5 becomes 22.
Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal256, Int256};
let d = SignedDecimal256::from_str("12.345").unwrap();
assert_eq!(d.to_int_trunc(), Int256::from(12));
let d = SignedDecimal256::from_str("-12.999").unwrap();
assert_eq!(d.to_int_trunc(), Int256::from(-12));
let d = SignedDecimal256::from_str("75.0").unwrap();
assert_eq!(d.to_int_trunc(), Int256::from(75));
sourcepub fn to_int_ceil(self) -> Int256
pub fn to_int_ceil(self) -> Int256
Converts this decimal to a signed integer by rounding up to the next integer, e.g. 22.3 becomes 23 and -1.2 becomes -1.
Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal256, Int256};
let d = SignedDecimal256::from_str("12.345").unwrap();
assert_eq!(d.to_int_ceil(), Int256::from(13));
let d = SignedDecimal256::from_str("-12.999").unwrap();
assert_eq!(d.to_int_ceil(), Int256::from(-12));
let d = SignedDecimal256::from_str("75.0").unwrap();
assert_eq!(d.to_int_ceil(), Int256::from(75));
Trait Implementations§
source§impl Add<&SignedDecimal256> for &SignedDecimal256
impl Add<&SignedDecimal256> for &SignedDecimal256
§type Output = <SignedDecimal256 as Add>::Output
type Output = <SignedDecimal256 as Add>::Output
+
operator.source§fn add(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
fn add( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
+
operation. Read moresource§impl Add<&SignedDecimal256> for SignedDecimal256
impl Add<&SignedDecimal256> for SignedDecimal256
§type Output = <SignedDecimal256 as Add>::Output
type Output = <SignedDecimal256 as Add>::Output
+
operator.source§fn add(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
fn add( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
+
operation. Read moresource§impl<'a> Add<SignedDecimal256> for &'a SignedDecimal256
impl<'a> Add<SignedDecimal256> for &'a SignedDecimal256
§type Output = <SignedDecimal256 as Add>::Output
type Output = <SignedDecimal256 as Add>::Output
+
operator.source§fn add(
self,
other: SignedDecimal256
) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
fn add( self, other: SignedDecimal256 ) -> <SignedDecimal256 as Add<SignedDecimal256>>::Output
+
operation. Read moresource§impl Add for SignedDecimal256
impl Add for SignedDecimal256
source§impl AddAssign<&SignedDecimal256> for SignedDecimal256
impl AddAssign<&SignedDecimal256> for SignedDecimal256
source§fn add_assign(&mut self, other: &SignedDecimal256)
fn add_assign(&mut self, other: &SignedDecimal256)
+=
operation. Read moresource§impl AddAssign for SignedDecimal256
impl AddAssign for SignedDecimal256
source§fn add_assign(&mut self, rhs: SignedDecimal256)
fn add_assign(&mut self, rhs: SignedDecimal256)
+=
operation. Read moresource§impl Clone for SignedDecimal256
impl Clone for SignedDecimal256
source§fn clone(&self) -> SignedDecimal256
fn clone(&self) -> SignedDecimal256
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SignedDecimal256
impl Debug for SignedDecimal256
source§impl Default for SignedDecimal256
impl Default for SignedDecimal256
source§fn default() -> SignedDecimal256
fn default() -> SignedDecimal256
source§impl<'de> Deserialize<'de> for SignedDecimal256
impl<'de> Deserialize<'de> for SignedDecimal256
Deserializes as a base64 string
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
source§impl Display for SignedDecimal256
impl Display for SignedDecimal256
source§impl Div<&SignedDecimal256> for &SignedDecimal256
impl Div<&SignedDecimal256> for &SignedDecimal256
§type Output = <SignedDecimal256 as Div>::Output
type Output = <SignedDecimal256 as Div>::Output
/
operator.source§fn div(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
fn div( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
/
operation. Read moresource§impl Div<&SignedDecimal256> for SignedDecimal256
impl Div<&SignedDecimal256> for SignedDecimal256
§type Output = <SignedDecimal256 as Div>::Output
type Output = <SignedDecimal256 as Div>::Output
/
operator.source§fn div(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
fn div( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
/
operation. Read moresource§impl Div<Int256> for SignedDecimal256
impl Div<Int256> for SignedDecimal256
source§impl<'a> Div<SignedDecimal256> for &'a SignedDecimal256
impl<'a> Div<SignedDecimal256> for &'a SignedDecimal256
§type Output = <SignedDecimal256 as Div>::Output
type Output = <SignedDecimal256 as Div>::Output
/
operator.source§fn div(
self,
other: SignedDecimal256
) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
fn div( self, other: SignedDecimal256 ) -> <SignedDecimal256 as Div<SignedDecimal256>>::Output
/
operation. Read moresource§impl Div for SignedDecimal256
impl Div for SignedDecimal256
source§impl DivAssign<&SignedDecimal256> for SignedDecimal256
impl DivAssign<&SignedDecimal256> for SignedDecimal256
source§fn div_assign(&mut self, other: &SignedDecimal256)
fn div_assign(&mut self, other: &SignedDecimal256)
/=
operation. Read moresource§impl DivAssign<Int256> for SignedDecimal256
impl DivAssign<Int256> for SignedDecimal256
source§fn div_assign(&mut self, rhs: Int256)
fn div_assign(&mut self, rhs: Int256)
/=
operation. Read moresource§impl DivAssign for SignedDecimal256
impl DivAssign for SignedDecimal256
source§fn div_assign(&mut self, rhs: SignedDecimal256)
fn div_assign(&mut self, rhs: SignedDecimal256)
/=
operation. Read moresource§impl Fraction<Int256> for SignedDecimal256
impl Fraction<Int256> for SignedDecimal256
source§impl From<Decimal> for SignedDecimal256
impl From<Decimal> for SignedDecimal256
source§impl From<SignedDecimal> for SignedDecimal256
impl From<SignedDecimal> for SignedDecimal256
source§fn from(value: SignedDecimal) -> Self
fn from(value: SignedDecimal) -> Self
source§impl FromStr for SignedDecimal256
impl FromStr for SignedDecimal256
source§fn from_str(input: &str) -> Result<Self, Self::Err>
fn from_str(input: &str) -> Result<Self, Self::Err>
Converts the decimal string to a SignedDecimal256 Possible inputs: “1.23”, “1”, “000012”, “1.123000000”, “-1.12300” Disallowed: “”, “.23”
This never performs any kind of rounding. More than DECIMAL_PLACES fractional digits, even zeros, result in an error.
source§impl JsonSchema for SignedDecimal256
impl JsonSchema for SignedDecimal256
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl Mul<&SignedDecimal256> for &SignedDecimal256
impl Mul<&SignedDecimal256> for &SignedDecimal256
§type Output = <SignedDecimal256 as Mul>::Output
type Output = <SignedDecimal256 as Mul>::Output
*
operator.source§fn mul(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
fn mul( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
*
operation. Read moresource§impl Mul<&SignedDecimal256> for SignedDecimal256
impl Mul<&SignedDecimal256> for SignedDecimal256
§type Output = <SignedDecimal256 as Mul>::Output
type Output = <SignedDecimal256 as Mul>::Output
*
operator.source§fn mul(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
fn mul( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
*
operation. Read moresource§impl<'a> Mul<SignedDecimal256> for &'a SignedDecimal256
impl<'a> Mul<SignedDecimal256> for &'a SignedDecimal256
§type Output = <SignedDecimal256 as Mul>::Output
type Output = <SignedDecimal256 as Mul>::Output
*
operator.source§fn mul(
self,
other: SignedDecimal256
) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
fn mul( self, other: SignedDecimal256 ) -> <SignedDecimal256 as Mul<SignedDecimal256>>::Output
*
operation. Read moresource§impl Mul for SignedDecimal256
impl Mul for SignedDecimal256
source§impl MulAssign<&SignedDecimal256> for SignedDecimal256
impl MulAssign<&SignedDecimal256> for SignedDecimal256
source§fn mul_assign(&mut self, other: &SignedDecimal256)
fn mul_assign(&mut self, other: &SignedDecimal256)
*=
operation. Read moresource§impl MulAssign for SignedDecimal256
impl MulAssign for SignedDecimal256
source§fn mul_assign(&mut self, rhs: SignedDecimal256)
fn mul_assign(&mut self, rhs: SignedDecimal256)
*=
operation. Read moresource§impl Neg for SignedDecimal256
impl Neg for SignedDecimal256
source§impl Ord for SignedDecimal256
impl Ord for SignedDecimal256
source§fn cmp(&self, other: &SignedDecimal256) -> Ordering
fn cmp(&self, other: &SignedDecimal256) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<&SignedDecimal256> for SignedDecimal256
impl PartialEq<&SignedDecimal256> for SignedDecimal256
source§fn eq(&self, rhs: &&SignedDecimal256) -> bool
fn eq(&self, rhs: &&SignedDecimal256) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<SignedDecimal256> for &'a SignedDecimal256
impl<'a> PartialEq<SignedDecimal256> for &'a SignedDecimal256
source§fn eq(&self, rhs: &SignedDecimal256) -> bool
fn eq(&self, rhs: &SignedDecimal256) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for SignedDecimal256
impl PartialEq for SignedDecimal256
source§fn eq(&self, other: &SignedDecimal256) -> bool
fn eq(&self, other: &SignedDecimal256) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SignedDecimal256
impl PartialOrd for SignedDecimal256
source§fn partial_cmp(&self, other: &SignedDecimal256) -> Option<Ordering>
fn partial_cmp(&self, other: &SignedDecimal256) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Rem<&SignedDecimal256> for &SignedDecimal256
impl Rem<&SignedDecimal256> for &SignedDecimal256
§type Output = <SignedDecimal256 as Rem>::Output
type Output = <SignedDecimal256 as Rem>::Output
%
operator.source§fn rem(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
fn rem( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
%
operation. Read moresource§impl Rem<&SignedDecimal256> for SignedDecimal256
impl Rem<&SignedDecimal256> for SignedDecimal256
§type Output = <SignedDecimal256 as Rem>::Output
type Output = <SignedDecimal256 as Rem>::Output
%
operator.source§fn rem(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
fn rem( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
%
operation. Read moresource§impl<'a> Rem<SignedDecimal256> for &'a SignedDecimal256
impl<'a> Rem<SignedDecimal256> for &'a SignedDecimal256
§type Output = <SignedDecimal256 as Rem>::Output
type Output = <SignedDecimal256 as Rem>::Output
%
operator.source§fn rem(
self,
other: SignedDecimal256
) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
fn rem( self, other: SignedDecimal256 ) -> <SignedDecimal256 as Rem<SignedDecimal256>>::Output
%
operation. Read moresource§impl Rem for SignedDecimal256
impl Rem for SignedDecimal256
source§impl RemAssign<&SignedDecimal256> for SignedDecimal256
impl RemAssign<&SignedDecimal256> for SignedDecimal256
source§fn rem_assign(&mut self, other: &SignedDecimal256)
fn rem_assign(&mut self, other: &SignedDecimal256)
%=
operation. Read moresource§impl RemAssign for SignedDecimal256
impl RemAssign for SignedDecimal256
source§fn rem_assign(&mut self, rhs: SignedDecimal256)
fn rem_assign(&mut self, rhs: SignedDecimal256)
%=
operation. Read moresource§impl Serialize for SignedDecimal256
impl Serialize for SignedDecimal256
Serializes as a decimal string
source§impl Sub<&SignedDecimal256> for &SignedDecimal256
impl Sub<&SignedDecimal256> for &SignedDecimal256
§type Output = <SignedDecimal256 as Sub>::Output
type Output = <SignedDecimal256 as Sub>::Output
-
operator.source§fn sub(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
fn sub( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
-
operation. Read moresource§impl Sub<&SignedDecimal256> for SignedDecimal256
impl Sub<&SignedDecimal256> for SignedDecimal256
§type Output = <SignedDecimal256 as Sub>::Output
type Output = <SignedDecimal256 as Sub>::Output
-
operator.source§fn sub(
self,
other: &SignedDecimal256
) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
fn sub( self, other: &SignedDecimal256 ) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
-
operation. Read moresource§impl<'a> Sub<SignedDecimal256> for &'a SignedDecimal256
impl<'a> Sub<SignedDecimal256> for &'a SignedDecimal256
§type Output = <SignedDecimal256 as Sub>::Output
type Output = <SignedDecimal256 as Sub>::Output
-
operator.source§fn sub(
self,
other: SignedDecimal256
) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
fn sub( self, other: SignedDecimal256 ) -> <SignedDecimal256 as Sub<SignedDecimal256>>::Output
-
operation. Read moresource§impl Sub for SignedDecimal256
impl Sub for SignedDecimal256
source§impl SubAssign<&SignedDecimal256> for SignedDecimal256
impl SubAssign<&SignedDecimal256> for SignedDecimal256
source§fn sub_assign(&mut self, other: &SignedDecimal256)
fn sub_assign(&mut self, other: &SignedDecimal256)
-=
operation. Read moresource§impl SubAssign for SignedDecimal256
impl SubAssign for SignedDecimal256
source§fn sub_assign(&mut self, rhs: SignedDecimal256)
fn sub_assign(&mut self, rhs: SignedDecimal256)
-=
operation. Read more