From d33a34c283761a9946030c382946e940d75c0f79 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" Date: Sat, 14 Mar 2026 18:29:36 +0900 Subject: [PATCH] Upgrade pymath to 0.2.0 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/stdlib/src/math.rs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68adc9d682c..ab506138fcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2550,9 +2550,9 @@ dependencies = [ [[package]] name = "pymath" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfb6723b732fc7f0b29a0ee7150c7f70f947bf467b8c3e82530b13589a78b4c" +checksum = "bc10e50b7a1f2cc3887e983721cb51fc7574be0066c84bff3ef9e5c096e8d6d5" dependencies = [ "libc", "libm", diff --git a/Cargo.toml b/Cargo.toml index 2f720de968a..78b0e20e9b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,7 +200,7 @@ optional = "0.5" parking_lot = "0.12.3" paste = "1.0.15" proc-macro2 = "1.0.105" -pymath = { version = "0.1.5", features = ["mul_add", "malachite-bigint", "complex"] } +pymath = { version = "0.2.0", features = ["mul_add", "malachite-bigint", "complex"] } quote = "1.0.45" radium = "1.1.1" rand = "0.9" diff --git a/crates/stdlib/src/math.rs b/crates/stdlib/src/math.rs index b071ff5aad7..b2ef4a42ba7 100644 --- a/crates/stdlib/src/math.rs +++ b/crates/stdlib/src/math.rs @@ -712,7 +712,8 @@ mod math { } // Finalize float path if !flt_p_values.is_empty() { - let flt_result = pymath::math::sumprod(&flt_p_values, &flt_q_values); + let flt_result = pymath::math::sumprod(&flt_p_values, &flt_q_values) + .map_err(|err| pymath_exception(err, vm))?; let flt_obj: PyObjectRef = vm.ctx.new_float(flt_result).into(); obj_total = Some(match obj_total { Some(total) => vm._add(&total, &flt_obj)?,