Positron Compiler Documentation

FloatIng Point Exception Flags

Positron16 · Revision 1.1.3.5 · PDF page 36

The floating point exception flags are accessible from within the BASIC program via the system variable _FP_FLAGS.

The exceptions are:

_FP_FLAGS.1     ' FloatIng point overflow
_FP_FLAGS.2     ' FloatIng point underflow
_FP_FLAGS.3     ' FloatIng point divide by zero
_FP_FLAGS.5     ' Domain error exception

The exception bits can be aliased for more readability within the program:

  Symbol FpOverflow    = _FP_FLAGS.1  ' FloatIng point overflow
   Symbol FpUnderFlow   = _FP_FLAGS.2  ' FloatIng point underflow
   Symbol FpDiv0        = _FP_FLAGS.3  ' FloatIng point divide by zero
   Symbol FpDomainError = _FP_FLAGS.5  ' Domain error exception

After an exception is detected and handled in the program, the exception bit should be cleared so that new exceptions can be detected, however, exceptions can be ignored because new operations are not affected by old exceptions.

See also : Dim, Symbol, Aliases, Arrays.

View original PDF page 36Open page in PDFOriginal PDF page 36