
We have an interesting situation where a test suite that checks the value of e^-inf is behaving differently depending on Numpy version. The minimal test I'm using is: #!/usr/bin/env python3 import numpy as np np.seterr(under='raise') print(np.exp(np.NINF)) With numpy version 1.19.5 and 1.20.3 we consistently get "0.0" as the result. Later versions- 1.21 and 1.22- raise an underflow error: Traceback (most recent call last): File "./under.py", line 4, in <module> print(np.exp(np.NINF)) FloatingPointError: underflow encountered in exp A further confounding factor is that on our slightly older processors we don't get this underflow, instead returning 0. The Python and GCC toolchains is the same thanks to environment modules and the OS and patches are the same on both generations, but the older processors (Intel Xeon E5-2667) return 0 and the newer (Intel Xeon Gold 6254) return underflow with the newer numpy versions. I think my primary question is what is the expected result for this function? I sort of expect this to be defined as zero but I've been unable to find documentation of this fact. Underflow does sort of make sense in this situation as well. However, the inconsistency is concerning and I'm uncertain if it would affect results from other calculations. Thanks much - Michael