Skip to content

Commit

Permalink
Fix number rounding with MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Nov 8, 2023
1 parent 2f51cbc commit 826f05e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define MALLOC_OVERHEAD 8
#endif

#if !defined(_WIN32)
#if !defined(_WIN32) || defined(__MINGW32__)
/* define it if printf uses the RNDN rounding mode instead of RNDNA */
#define CONFIG_PRINTF_RNDN
#endif
Expand Down
5 changes: 0 additions & 5 deletions tests/test_builtin.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ function test_number()
assert(Number.isNaN(Number("-")));
assert(Number.isNaN(Number("\x00a")));

// TODO: Fix rounding error on MinGW.
if (std.getenv('MSYSTEM')) {
return;
}

assert((25).toExponential(0), "3e+1");
assert((-25).toExponential(0), "-3e+1");
assert((2.5).toPrecision(1), "3");
Expand Down

0 comments on commit 826f05e

Please sign in to comment.