components/desktop/firefox/patches/firefox27-80-mftt_infinity.patch
changeset 5255 cea0e462549a
equal deleted inserted replaced
5252:947514442d05 5255:cea0e462549a
       
     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 --- mozilla-esr31/mfbt/decimal/Decimal.cpp.orig	2015-06-04 17:42:52.191270749 -0700
       
     6 +++ mozilla-esr31/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)