[−][src]Trait fixnum::ops::CheckedSub
Associated Types
Loading content...Required methods
pub fn csub(self, rhs: Rhs) -> Result<Self::Output, Self::Error>
[src]
Checked subtraction. Returns Err
on overflow.
use fixnum::{FixedPoint, typenum::U9, ops::CheckedSub}; type Amount = FixedPoint<i64, U9>; fn amount(s: &str) -> FixedPoint<i64, U9> { s.parse().unwrap() } assert_eq!(amount("0.3").csub(amount("0.1"))?, amount("0.2"));
Implementations on Foreign Types
impl CheckedSub<i8> for i8
[src]
type Output = i8
type Error = ArithmeticError
pub fn csub(self, rhs: Self) -> Result<Self::Output, Self::Error>
[src]
impl CheckedSub<i16> for i16
[src]
type Output = i16
type Error = ArithmeticError
pub fn csub(self, rhs: Self) -> Result<Self::Output, Self::Error>
[src]
impl CheckedSub<i32> for i32
[src]
type Output = i32
type Error = ArithmeticError
pub fn csub(self, rhs: Self) -> Result<Self::Output, Self::Error>
[src]
impl CheckedSub<i64> for i64
[src]
type Output = i64
type Error = ArithmeticError
pub fn csub(self, rhs: Self) -> Result<Self::Output, Self::Error>
[src]
impl CheckedSub<i128> for i128
[src]
type Output = i128
type Error = ArithmeticError
pub fn csub(self, rhs: Self) -> Result<Self::Output, Self::Error>
[src]
Implementors
impl<P: Precision> CheckedSub<FixedPoint<i16, P>> for FixedPoint<i16, P>
[src]
type Output = FixedPoint<i16, P>
type Error = ArithmeticError
pub fn csub(
self,
rhs: FixedPoint<i16, P>
) -> Result<FixedPoint<i16, P>, ArithmeticError>
[src]
self,
rhs: FixedPoint<i16, P>
) -> Result<FixedPoint<i16, P>, ArithmeticError>
impl<P: Precision> CheckedSub<FixedPoint<i32, P>> for FixedPoint<i32, P>
[src]
type Output = FixedPoint<i32, P>
type Error = ArithmeticError
pub fn csub(
self,
rhs: FixedPoint<i32, P>
) -> Result<FixedPoint<i32, P>, ArithmeticError>
[src]
self,
rhs: FixedPoint<i32, P>
) -> Result<FixedPoint<i32, P>, ArithmeticError>
impl<P: Precision> CheckedSub<FixedPoint<i64, P>> for FixedPoint<i64, P>
[src]
type Output = FixedPoint<i64, P>
type Error = ArithmeticError
pub fn csub(
self,
rhs: FixedPoint<i64, P>
) -> Result<FixedPoint<i64, P>, ArithmeticError>
[src]
self,
rhs: FixedPoint<i64, P>
) -> Result<FixedPoint<i64, P>, ArithmeticError>