forked from lijiext/lammps
Add range checks for MathSpecial::fm_exp
This commit is contained in:
parent
a231197c10
commit
cb20cb9f25
|
@ -538,6 +538,8 @@ double MathSpecial::exp2_x86(double x)
|
|||
double MathSpecial::fm_exp(double x)
|
||||
{
|
||||
#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);
|
||||
#else
|
||||
return ::exp(x);
|
||||
|
|
Loading…
Reference in New Issue