pub fn apply<F: Fn(i128, i128) -> i128, G: Fn(f64, f64) -> f64>(
        self,
        b: Literal,
        f: F,
        g: G,
    ) -> Literal {
        match (self, b) {
            (Literal::Integer(a), Literal::Integer(b)) => Literal::Integer(f(a, b)),
            (Literal::Real(a), Literal::Integer(b)) => Literal::Real(g(a, b as f64)),
            (Literal::Integer(a), Literal::Real(b)) => Literal::Real(g(a as f64, b)),
            (Literal::Real(a), Literal::Real(b)) => Literal::Real(g(a, b)),
        }
    }
//It's meant to make to make it easier use binary functions on either.
It's meant to make to make it easier use binary functions on either.
It ' s meant to make to make it easier use binary functions on either .
pub fn apply<F: Fn(i128, i128) -> i128, G: Fn(f64, f64) -> f64>(
        self,
        b: Literal,
        f: F,
        g: G,
    ) -> Literal {
        match (self, b) {
            (Literal::Integer(a), Literal::Integer(b)) => Literal::Integer(f(a, b)),
            (Literal::Real(a), Literal::Integer(b)) => Literal::Real(g(a, b as f64)),
            (Literal::Integer(a), Literal::Real(b)) => Literal::Real(g(a as f64, b)),
            (Literal::Real(a), Literal::Real(b)) => Literal::Real(g(a, b)),
        }
    }
pub fn apply < F : Fn ( i128 , i128 ) -> i128 , G : Fn ( f64 , f64 ) -> f64 > ( self , b : Literal , f : F , g : G , ) -> Literal { match ( self , b ) { ( Literal :: Integer ( a ) , Literal :: Integer ( b ) ) => Literal :: Integer ( f ( a , b ) ) , ( Literal :: Real ( a ) , Literal :: Integer ( b ) ) => Literal :: Real ( g ( a , b as f64 ) ) , ( Literal :: Integer ( a ) , Literal :: Real ( b ) ) => Literal :: Real ( g ( a as f64 , b ) ) , ( Literal :: Real ( a ) , Literal :: Real ( b ) ) => Literal :: Real ( g ( a , b ) ) , } }
It's meant to make to make it easier use binary functions on either.
It ' s meant to make to make it easier use binary functions on either .
self
b
Literal
f
F
g
G
self
b
Literal
f
F
g
G