From 213b76af10172e832dc097d86f132869e41f1610 Mon Sep 17 00:00:00 2001 From: Harrison Booth <73434116+Harrison-Booth@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:39:26 -0500 Subject: [PATCH] Expand bit shift boundary regressions --- crates/functions/src/engineering.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/functions/src/engineering.rs b/crates/functions/src/engineering.rs index a02196f41..96d73bf78 100644 --- a/crates/functions/src/engineering.rs +++ b/crates/functions/src/engineering.rs @@ -450,12 +450,19 @@ mod tests { is_err(ev("BITLSHIFT", vec![n(1.0), n(54.0)]), CellError::Num); is_err(ev("BITLSHIFT", vec![n(2f64.powi(47)), n(1.0)]), CellError::Num); for f in ["BITLSHIFT", "BITRSHIFT"] { - for shift in [-100.0, -54.0, 54.0, 100.0] { + for shift in [-100.0, -54.0, -53.0, 53.0, 54.0, 100.0] { close(ev(f, vec![n(0.0), n(shift)]), 0.0); } - is_err(ev(f, vec![n(1.0), n(54.0)]), CellError::Num); + for shift in [-100.0, -54.0, 54.0, 100.0] { + is_err(ev(f, vec![n(1.0), n(shift)]), CellError::Num); + } + if f == "BITLSHIFT" { + is_err(ev(f, vec![n(1.0), n(53.0)]), CellError::Num); + } else { + close(ev(f, vec![n(1.0), n(53.0)]), 0.0); + } + is_err(ev(f, vec![n(0.0), t("bad")]), CellError::Value); } - is_err(ev("BITLSHIFT", vec![n(0.0), t("bad")]), CellError::Value); is_err(ev("BITRSHIFT", vec![n(-1.0), n(100.0)]), CellError::Num); }