DecimalControl

Container for _decimal context control, provides methods to alter exception handling, manually edit error flags, adjust arithmetic precision and rounding mode

Members

Manifest constants

is754version1985
enum is754version1985;

true if this programming environment conforms to IEEE 754-1985

is754version2008
enum is754version2008;

true if this programming environment conforms to IEEE 754-2008

Properties

divisionByZero
bool divisionByZero [@property getter]

IEEE _decimal context errors. By default, no error is set.

enabledExceptions
ExceptionFlags enabledExceptions [@property getter]

Extracts current enabled exceptions.

inexact
bool inexact [@property getter]

IEEE _decimal context errors. By default, no error is set.

invalidOperation
bool invalidOperation [@property getter]
overflow
bool overflow [@property getter]
underflow
bool underflow [@property getter]

IEEE _decimal context errors. By default, no error is set.

Static functions

disableExceptions
void disableExceptions(ExceptionFlags group)
void disableExceptions()

Disables specified exceptions. Multiple exceptions may be ORed together.

enableExceptions
void enableExceptions(ExceptionFlags group)

Enables specified exceptions. Multiple exceptions may be ORed together.

hasFlags
bool hasFlags(ExceptionFlags group)

Checks if the specified error flags are set. Multiple exceptions may be ORed together.

raiseFlags
void raiseFlags(ExceptionFlags group)

Sets specified error flags. Multiple errors may be ORed together.

resetFlags
void resetFlags(ExceptionFlags group)
void resetFlags()

Unsets specified error flags. Multiple errors may be ORed together.

restoreFlags
void restoreFlags(ExceptionFlags group)

Enables specified error flags (group) without throwing corresponding exceptions.

saveFlags
ExceptionFlags saveFlags()

Returns the current set flags.

Static variables

precision
Precision precision;

Gets or sets the precision applied to peration results. See Precision for details.

rounding
RoundingMode rounding;

Gets or sets the rounding mode used when the result of an operation exceeds the _decimal precision. See RoundingMode for details.

Meta