Add range checks for MathSpecial::fm_exp
This commit is contained in:
@ -538,6 +538,8 @@ double MathSpecial::exp2_x86(double x)
|
|||||||
double MathSpecial::fm_exp(double x)
|
double MathSpecial::fm_exp(double x)
|
||||||
{
|
{
|
||||||
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
|
if (x < -1022.0/FM_DOUBLE_LOG2OFE) return 0;
|
||||||
|
if (x > 1023.0/FM_DOUBLE_LOG2OFE) return INFINITY;
|
||||||
return exp2_x86(FM_DOUBLE_LOG2OFE * x);
|
return exp2_x86(FM_DOUBLE_LOG2OFE * x);
|
||||||
#else
|
#else
|
||||||
return ::exp(x);
|
return ::exp(x);
|
||||||
|
|||||||
Reference in New Issue
Block a user