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