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 --- comm-esr31/mozilla/mfbt/decimal/Decimal.cpp.orig 2015-06-04 17:42:52.191270749 -0700 |
|
6 +++ comm-esr31/mozilla/mfbt/decimal/Decimal.cpp 2015-06-04 17:42:52.193703088 -0700 |
|
7 @@ -33,6 +33,7 @@ |
|
8 |
|
9 #include <algorithm> |
|
10 #include <float.h> |
|
11 +#include <ieeefp.h> |
|
12 |
|
13 using namespace moz_decimal_utils; |
|
14 |
|
15 @@ -686,13 +687,13 @@ |
|
16 |
|
17 Decimal Decimal::fromDouble(double doubleValue) |
|
18 { |
|
19 - if (std::isfinite(doubleValue)) |
|
20 + if (finite(doubleValue)) |
|
21 return fromString(mozToString(doubleValue)); |
|
22 |
|
23 - if (std::isinf(doubleValue)) |
|
24 - return infinity(doubleValue < 0 ? Negative : Positive); |
|
25 + if (isnand(doubleValue)) |
|
26 + return nan(); |
|
27 |
|
28 - return nan(); |
|
29 + return infinity(doubleValue < 0 ? Negative : Positive); |
|
30 } |
|
31 |
|
32 Decimal Decimal::fromString(const String& str) |