Remarkably numpy.log() gives a runtime overflow warning on a float32 array containing values larger than 1e9. Numpy 1.19.4, macOS 10.15.7, MacBookPro15,3. Warning does not appear for float64 array even for much larger values (e.g. 1e35).
Reproducing code example:
import numpy as np
a = np.array([1e9], np.float32)
np.log(a)
Error message:
RuntimeWarning: overflow encountered in log
NumPy/Python version information:
1.19.4 3.8.6 (default, Nov 20 2020, 18:29:40)
[Clang 12.0.0 (clang-1200.0.32.27)]
Remarkably numpy.log() gives a runtime overflow warning on a float32 array containing values larger than 1e9. Numpy 1.19.4, macOS 10.15.7, MacBookPro15,3. Warning does not appear for float64 array even for much larger values (e.g. 1e35).
Reproducing code example:
Error message:
RuntimeWarning: overflow encountered in log
NumPy/Python version information:
1.19.4 3.8.6 (default, Nov 20 2020, 18:29:40)
[Clang 12.0.0 (clang-1200.0.32.27)]