Raymond Toy pushed to branch issue-298-with-float-rounding-mode at cmucl / cmucl
Commits: 6181fd24 by Raymond Toy at 2024-04-08T05:52:20-07:00 Fix up docstring for with-float-rounding-mode
Mention that the allowed values are the same as the values for the rounding-mode in `set-floating-point-modes`.
Change indentation of docstring slightly so that it prints nicely via `describe`. (Emacs doesn't indent the docstring by the right amount for `describe`.)
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
===================================== src/code/float-trap.lisp ===================================== @@ -498,17 +498,20 @@
(defmacro with-float-rounding-mode ((rounding-mode) &body body) _N"Execute BODY with the floating-point rounding mode set to - ROUNDING-MODE. ROUNDING-MODE must a one of + ROUNDING-MODE. ROUNDING-MODE must be a one:
- :NEAREST - the default mode of round to nearest even - :ZERO + :NEAREST + the default mode of round to nearest even. + :ZERO round numbers down towards zero. Positive numbers round down and negative numbers round up. - :POSITIVE-INFINITY - round numbers up towards positive infinity - :NEGATIVE-INFINITY - round numbers down towards negative infinity + :POSITIVE-INFINITY + round numbers up towards positive infinity. + :NEGATIVE-INFINITY + round numbers down towards negative infinity. + + These are the same as the possible values for the rounding mode in + SET-FLOATING-POINT-MODES.
Only the rounding mode is restored on exit; other floating-point modes are not modified. "
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6181fd24b8de80cde307ddf4...