mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-21 10:01:55 +01:00
fix(actions): preserve negative zero in Math.round (M6)
Preserve the sign of negative fractions rounded to zero in the exported HTML player.
This commit is contained in:
1 file changed
+1
@@ -551,6 +551,7 @@ var AniCraft = (function () {
|
||||
// Math.round as the Rust evaluator computes it.
|
||||
function round(x) {
|
||||
if (!Number.isFinite(x)) return x;
|
||||
if (x >= -0.5 && x < 0) return -0;
|
||||
const f = Math.floor(x);
|
||||
return x - f >= 0.5 ? f + 1 : f;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user