MCPcopy Create free account
hub / github.com/numpy/numpy / check_floatstatus

Function check_floatstatus

numpy/core/tests/test_simd.py:9–21  ·  view source on GitHub ↗
(divbyzero=False, overflow=False,
                      underflow=False, invalid=False,
                      all=False)

Source from the content-addressed store, hash-verified

7from numpy.core._multiarray_umath import __cpu_baseline__
8
9def check_floatstatus(divbyzero=False, overflow=False,
10 underflow=False, invalid=False,
11 all=False):
12 #define NPY_FPE_DIVIDEBYZERO 1
13 #define NPY_FPE_OVERFLOW 2
14 #define NPY_FPE_UNDERFLOW 4
15 #define NPY_FPE_INVALID 8
16 err = get_floatstatus()
17 ret = (all or divbyzero) and (err & 1) != 0
18 ret |= (all or overflow) and (err & 2) != 0
19 ret |= (all or underflow) and (err & 4) != 0
20 ret |= (all or invalid) and (err & 8) != 0
21 return ret
22
23class _Test_Utility:
24 # submodule of the desired SIMD extension, e.g. targets["AVX512F"]

Callers 1

Calls 1

get_floatstatusFunction · 0.90

Tested by

no test coverage detected