From c3f84a48c428067c72f74300fe3e8b218627ea17 Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Sun, 27 Oct 2024 12:28:46 -0700 Subject: [PATCH] handle missing case for multiplication --- crates/steel-core/src/primitives/numbers.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/steel-core/src/primitives/numbers.rs b/crates/steel-core/src/primitives/numbers.rs index de0ddfd72..c1eca8b35 100644 --- a/crates/steel-core/src/primitives/numbers.rs +++ b/crates/steel-core/src/primitives/numbers.rs @@ -1365,6 +1365,14 @@ pub fn add_two(x: &SteelVal, y: &SteelVal) -> Result { debug_assert!(realp(y)); add_complex(x, &SteelComplex::new(y.clone(), SteelVal::IntV(0))) } + (SteelVal::BigRational(x), SteelVal::Rational(y)) => { + let mut res = BigRational::new( + BigInt::from(x.numer().clone()), + BigInt::from(x.denom().clone()), + ); + res *= BigRational::new(BigInt::from(*y.numer()), BigInt::from(*y.denom())); + res.into_steelval() + } _ => unreachable!(), } }