equal
deleted
inserted
replaced
1 We use a different function from the one in ieeefp.h. |
|
2 This may be a studio specific patch. Need to investigate if this can be |
|
3 removed. |
|
4 |
|
5 diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp |
|
6 --- a/mfbt/decimal/Decimal.cpp |
|
7 +++ b/mfbt/decimal/Decimal.cpp |
|
8 @@ -33,6 +33,7 @@ |
|
9 |
|
10 #include <algorithm> |
|
11 #include <float.h> |
|
12 +#include <ieeefp.h> |
|
13 |
|
14 using namespace moz_decimal_utils; |
|
15 |
|
16 @@ -686,13 +687,13 @@ |
|
17 |
|
18 Decimal Decimal::fromDouble(double doubleValue) |
|
19 { |
|
20 - if (std::isfinite(doubleValue)) |
|
21 + if (finite(doubleValue)) |
|
22 return fromString(mozToString(doubleValue)); |
|
23 |
|
24 - if (std::isinf(doubleValue)) |
|
25 - return infinity(doubleValue < 0 ? Negative : Positive); |
|
26 + if (isnand(doubleValue)) |
|
27 + return nan(); |
|
28 |
|
29 - return nan(); |
|
30 + return infinity(doubleValue < 0 ? Negative : Positive); |
|
31 } |
|
32 |
|
33 Decimal Decimal::fromString(const String& str) |
|