From 7a340e8899126d83b5ccb36b0aac2d98dcdb328a Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 23 Sep 2024 10:58:27 +0100 Subject: [PATCH] Ensure x%Infinity===x (fix #2542) --- ChangeLog | 1 + src/jswrap_math.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 617b27e74..ffabdc2d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ Ensure that 1%0.0===NaN (fix #2556) Ensure Number("1A")==NaN, previously we just parsed the digits we could (fix #2555) First argument of operators is now dereferenced before parsing second argument (fix #2547) + Ensure x%Infinity===x (fix #2542) 2v24 : Bangle.js2: Add 'Bangle.touchRd()', 'Bangle.touchWr()' Bangle.js2: After Bangle.showTestScreen, put Bangle.js into a hard off state (not soft off) diff --git a/src/jswrap_math.c b/src/jswrap_math.c index 9185f8569..0a7d77792 100644 --- a/src/jswrap_math.c +++ b/src/jswrap_math.c @@ -267,6 +267,7 @@ double jswrap_math_mod(double x, double y) { if (!isfinite(x) || isnan(y) || y==0) return NAN; + if (y==INFINITY) return x; if (0 > c) { x = -x;