NumericStatus - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : Numerical Computations : Maple Numerics : Functions : NumericStatus

NumericStatus

sets, clears, or queries numeric event status flags

 Calling Sequence NumericStatus(event ...) NumericStatus(event = setting ...)

Parameters

 event - symbol that represents one of six numeric events setting - the setting of the status flag: true or false

Description

 • The NumericStatus command provides access to a set of global flags to record the status of numeric operations. One status flag corresponds to each numeric event (see NumericEvent). Status flags are set automatically by the internal event dispatching code before the corresponding default, exception, or handler action is invoked (see NumericEventHandler).
 • If the status flags are set, they remain set until they are explicitly cleared, that is, assigning true sets a flag and assigning false clears a flag. This means that NumericStatus is not an environment variable.
 • The names of the six status flags correspond to the event names, which are:

 invalid_operation division_by_zero overflow underflow inexact real_to_complex

 • User code can check the NumericStatus after a sequence of operations to determine if any numeric events were triggered (resulting in either default values or trapped exceptions) during the computation.
 • If called with an equation or expression sequence of equations of the form event=status, NumericStatus sets or clears the specified status for the specified event or events. It also returns an equation or expression sequence of equations that gives the previous status for the specified event (or events), which can be used as an argument to a subsequent call to NumericStatus to restore the previous status.
 • If called with an event name or expression sequence of event names, NumericStatus returns a value or an expression sequence of values that gives the current status for the specified event or events.
 • If called with no arguments, NumericStatus returns an expression sequence of equations that gives the current status for all events.
 • If called with the single argument false, NumericStatus clears the status of all events, and returns an expression sequence of equations that gives the previous status for all events, which can be used as an argument to a subsequent call to NumericStatus to restore the previous state.

Examples

 > $\mathrm{NumericStatus}\left(\right)$
 ${\mathrm{invalid_operation}}{=}{\mathrm{false}}{,}{\mathrm{division_by_zero}}{=}{\mathrm{false}}{,}{\mathrm{overflow}}{=}{\mathrm{false}}{,}{\mathrm{underflow}}{=}{\mathrm{false}}{,}{\mathrm{inexact}}{=}{\mathrm{false}}{,}{\mathrm{real_to_complex}}{=}{\mathrm{false}}$ (1)
 > f := proc(a,b) a/b end proc:
 > $f\left(3.0,0.\right)$
 ${Float}{}\left({\mathrm{\infty }}\right)$ (2)
 > $\mathrm{NumericStatus}\left(\mathrm{division_by_zero}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{NumericStatus}\left(\right)$
 ${\mathrm{invalid_operation}}{=}{\mathrm{false}}{,}{\mathrm{division_by_zero}}{=}{\mathrm{true}}{,}{\mathrm{overflow}}{=}{\mathrm{false}}{,}{\mathrm{underflow}}{=}{\mathrm{false}}{,}{\mathrm{inexact}}{=}{\mathrm{false}}{,}{\mathrm{real_to_complex}}{=}{\mathrm{false}}$ (4)
 > $\mathrm{NumericStatus}\left(\mathrm{division_by_zero}=\mathrm{false}\right)$
 ${\mathrm{division_by_zero}}{=}{\mathrm{true}}$ (5)
 > $\mathrm{NumericStatus}\left(\right)$
 ${\mathrm{invalid_operation}}{=}{\mathrm{false}}{,}{\mathrm{division_by_zero}}{=}{\mathrm{false}}{,}{\mathrm{overflow}}{=}{\mathrm{false}}{,}{\mathrm{underflow}}{=}{\mathrm{false}}{,}{\mathrm{inexact}}{=}{\mathrm{false}}{,}{\mathrm{real_to_complex}}{=}{\mathrm{false}}$ (6)

 See Also