pub fn float_add(self, rhs: Self, flag: RoundingFlag) -> MaybeNumber {
        let layout = self.layout();
        assert_eq!(layout, rhs.layout(), "adding numbers with different layout");
        match layout {
            Layout::Float(FloatLayout::BFloat16) => (bf16::from(self) + bf16::from(rhs)).into(),
            Layout::Float(FloatLayout::IeeeHalf) => {
                ieee::Half::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeSingle) => {
                ieee::Single::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeDouble) => {
                ieee::Double::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeQuad) => {
                ieee::Quad::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::X87DoubleExt) => {
                ieee::X87DoubleExtended::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeOct) => {
                ieee::Oct::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::FloatTapered) => todo!("(#5) tapered float addition"),
            Layout::Integer(_) => panic!("float addition of integer numbers"),
        }
    }
/// Addition of two floats with configuration flags for rounding.
///
/// # Panics
///
/// - if applied to float number layouts
/// - if numbers in arguments has different layout.
Addition of two floats with configuration flags for rounding.
Addition of two floats with configuration flags for rounding .
pub fn float_add(self, rhs: Self, flag: RoundingFlag) -> MaybeNumber {
        let layout = self.layout();
        assert_eq!(layout, rhs.layout(), "adding numbers with different layout");
        match layout {
            Layout::Float(FloatLayout::BFloat16) => (bf16::from(self) + bf16::from(rhs)).into(),
            Layout::Float(FloatLayout::IeeeHalf) => {
                ieee::Half::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeSingle) => {
                ieee::Single::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeDouble) => {
                ieee::Double::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeQuad) => {
                ieee::Quad::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::X87DoubleExt) => {
                ieee::X87DoubleExtended::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::IeeeOct) => {
                ieee::Oct::from(self).add_r(rhs.into(), flag.into()).into()
            }
            Layout::Float(FloatLayout::FloatTapered) => todo!("(#5) tapered float addition"),
            Layout::Integer(_) => panic!("float addition of integer numbers"),
        }
    }
pub fn float_add ( self , rhs : Self , flag : RoundingFlag ) -> MaybeNumber { let layout = self . layout ( ) ; assert_eq ! ( layout rhs layout ( ) " " ) ; match layout { Layout :: Float ( FloatLayout :: BFloat16 ) => ( bf16 :: from ( self ) + bf16 :: from ( rhs ) ) . into ( ) , Layout :: Float ( FloatLayout :: IeeeHalf ) => { ieee :: Half :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: IeeeSingle ) => { ieee :: Single :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: IeeeDouble ) => { ieee :: Double :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: IeeeQuad ) => { ieee :: Quad :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: X87DoubleExt ) => { ieee :: X87DoubleExtended :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: IeeeOct ) => { ieee :: Oct :: from ( self ) . add_r ( rhs . into ( ) , flag . into ( ) ) . into ( ) } Layout :: Float ( FloatLayout :: FloatTapered ) => todo ! ( " " ) , Layout :: Integer ( _ ) => panic ! ( " " ) , } }
Addition of two floats with configuration flags for rounding.
Addition of two floats with configuration flags for rounding .
self
rhs
Self
flag
RoundingFlag
self
rhs
Self
flag
RoundingFlag
panics
if applied to float number layouts
if numbers in arguments has different layout.
if applied to float number layouts if numbers in arguments has different layout .