fix NaN comparing equal to itself

This was broken both in comptime code and in runtime code.

closes #1174
This commit is contained in:
Andrew Kelley
2019-04-04 22:07:15 -04:00
parent 8e6ff8d615
commit 1dc6751721
6 changed files with 54 additions and 1 deletions

View File

@@ -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);
}