nlcpy.geterr

nlcpy.geterr()[ソース]

Gets the current way of handling floating-point errors.

Returns
resdict

A dictionary with keys "divide", "over", "under", and "invalid", whose values are from the strings "ignore", "print", "warn", and "raise". The keys represent possible floating-point exceptions, and the values define how these exceptions are handled. The elements of the shape tuple give the lengths of the corresponding array dimensions.

参考

seterr

Sets how floating-point errors are handled.

注釈

  • For complete documentation of the types of floating-point exceptions and treatment options, see nlcpy.seterr().

  • This function is the wrapper function to utilize numpy.geterr().

Examples

>>> import nlcpy as vp
>>> from collections import OrderedDict
>>> sorted(vp.geterr().items())
[('divide', 'warn'), ('invalid', 'warn'), ('over', 'warn'), ('under', 'ignore')]
>>> vp.arange(3.) / vp.arange(3.)
array([nan,  1.,  1.])