diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-04-04 22:07:15 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-04-04 22:07:15 -0400 |
| commit | 1dc6751721a2fe9990ea8fab4eadc95a29f53304 (patch) | |
| tree | fb85f1874651709f419567327241e94748d63bb8 /src/bigfloat.cpp | |
| parent | 8e6ff8d615820f7f732724a5db1639ae5f12fb4e (diff) | |
| download | zig-1dc6751721a2fe9990ea8fab4eadc95a29f53304.tar.gz zig-1dc6751721a2fe9990ea8fab4eadc95a29f53304.zip | |
fix NaN comparing equal to itself
This was broken both in comptime code and in runtime code.
closes #1174
Diffstat (limited to 'src/bigfloat.cpp')
| -rw-r--r-- | src/bigfloat.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bigfloat.cpp b/src/bigfloat.cpp index d746f1b68f..a2a3a3b69c 100644 --- a/src/bigfloat.cpp +++ b/src/bigfloat.cpp @@ -190,3 +190,7 @@ bool bigfloat_has_fraction(const BigFloat *bigfloat) { void bigfloat_sqrt(BigFloat *dest, const BigFloat *op) { f128M_sqrt(&op->value, &dest->value); } + +bool bigfloat_is_nan(const BigFloat *op) { + return f128M_isSignalingNaN(&op->value); +} |
