diff options
Diffstat (limited to 'src/support/safe_integer.cpp')
-rw-r--r-- | src/support/safe_integer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/support/safe_integer.cpp b/src/support/safe_integer.cpp index 23ef84b22..d43f7a6aa 100644 --- a/src/support/safe_integer.cpp +++ b/src/support/safe_integer.cpp @@ -22,7 +22,7 @@ using namespace wasm; -bool wasm::isInteger(double x) { return fmod(x, 1) == 0; } +bool wasm::isInteger(double x) { return trunc(x) == x && !std::isinf(x); } bool wasm::isUInteger32(double x) { return !std::signbit(x) && isInteger(x) && |