Table of Contents

Class FloatingPointError

Namespace
NumSharp
Assembly
NumSharp.dll

Python's FloatingPointError: the error NumPy raises for a floating-point exception when np.seterr(all='raise') (or np.errstate) turns warnings into errors, with NumPy's text (divide by zero encountered in divide, overflow encountered in exp).

public class FloatingPointError : ArithmeticError, ISerializable, INumSharpException
Inheritance
FloatingPointError
Implements
Inherited Members

Remarks

NumSharp itself never raises it: it has no floating-point error state (no np.seterr / np.errstate) and computes IEEE results (inf, nan) silently, as NumPy does under its default 'warn' mode minus the warning. The class exists so a port of code that raises or catches it compiles and behaves as in Python.

A subclass of ArithmeticError, as in Python.

Constructors

FloatingPointError()

Creates the error with Python's text for a bare raise FloatingPointError: an empty Message, as str(FloatingPointError()) is ''.

public FloatingPointError()

Remarks

ToString() then starts with the class name alone, as Python's traceback prints a bare FloatingPointError.

FloatingPointError(string)

Creates the error with NumPy's message.

public FloatingPointError(string message)

Parameters

message string

The text, verbatim: Python's str() of the error (divide by zero encountered in divide).

FloatingPointError(string, Exception)

Creates the error with a message and the exception that caused it: Python's raise FloatingPointError(message) from innerException, the cause kept in InnerException as Python keeps it in cause.

public FloatingPointError(string message, Exception innerException)

Parameters

message string

The text, verbatim: Python's str() of the error.

innerException Exception

The exception that led to this one, or null for none.