-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When using np.astype
and the array has inf
or nan
, I see a RuntimeWarning: invalid value encountered in cast
. On internal numpy float dtypes these are not emitted.
Run with python -Walways
import numpy as np
import numpy_quaddtype
a = np.arange(30, dtype=np.float32);
a[-1] = np.inf
q = numpy_quaddtype.QuadPrecision
d = np.float64
warns = a.astype(q)
# <stdin>:1: RuntimeWarning: invalid value encountered in cast
nowarns = a.astype(d)
# This does not warn
warns.astype(d)
I think this is coming from sleef?
Metadata
Metadata
Assignees
Labels
No labels