Controlling the floating-point environment


The math.floats.env vocabulary contains words for querying and controlling the floating-point environment.

Querying and setting exception flags:
fp-exception-flags ( -- exceptions )

set-fp-exception-flags ( exceptions -- )

clear-fp-exception-flags ( -- )

collect-fp-exceptions ( quot -- exceptions )


Querying and controlling processor traps for floating-point exceptions:
fp-traps ( -- exceptions )

with-fp-traps ( exceptions quot -- )

without-fp-traps ( quot -- )


Getting the floating-point exception state from errors raised by enabled traps:
vm-error>exception-flags ( error -- exceptions )

vm-error-exception-flag? ( error flag -- ? )


Querying and controlling the rounding mode and treatment of denormals:
rounding-mode ( -- mode )

with-rounding-mode ( mode quot -- )

denormal-mode ( -- mode )

with-denormal-mode ( mode quot -- )