diff --git a/src/code/exports.lisp b/src/code/exports.lisp index 0f224f6c23e2cce48b27c9d13bec23fe77d9c0fb..d3c8fa7fbdb66d997de64b9ed2359b9476a8ade6 100644 --- a/src/code/exports.lisp +++ b/src/code/exports.lisp @@ -1416,7 +1416,8 @@ "DOUBLE-FLOAT-NEGATIVE-INFINITY" "LONG-FLOAT-NEGATIVE-INFINITY" "GET-FLOATING-POINT-MODES" "SET-FLOATING-POINT-MODES" "FLOAT-DENORMALIZED-P" "FLOAT-INFINITY-P" - "FLOAT-NAN-P" "FLOAT-TRAPPING-NAN-P" + "FLOAT-NAN-P" "FLOAT-TRAPPING-NAN-P" + "FLOAT-SIGNALING-NAN-P" "WITH-FLOAT-TRAPS-MASKED") ;; More float extensions #+double-double diff --git a/src/code/float.lisp b/src/code/float.lisp index 9a7080d135faf765247f23a815ca7cbd1756c3e2..cace1a464838d3625c8b31afbc20f551574031f8 100644 --- a/src/code/float.lisp +++ b/src/code/float.lisp @@ -57,7 +57,8 @@ single-float-negative-infinity short-float-negative-infinity double-float-negative-infinity long-float-negative-infinity set-floating-point-modes float-denormalized-p float-nan-p - float-trapping-nan-p float-infinity-p)) + float-trapping-nan-p float-infinity-p + float-signaling-nan-p)) #+double-double (export '(least-positive-normalized-double-double-float @@ -285,7 +286,7 @@ ;;;; Float predicates and environment query: (declaim (maybe-inline float-denormalized-p float-infinity-p float-nan-p - float-trapping-nan-p)) + float-signaling-nan-p)) ;;; FLOAT-DENORMALIZED-P -- Public ;;; @@ -344,7 +345,7 @@ #+double-double (float-infinity-p (double-double-hi x))) - (frob float-nan-p "Return true if the float X is a NaN (Not a Number)." + (frob float-nan-p "Return true if the float X is a quiet or signaling NaN (Not a Number)." (not (zerop (ldb vm:single-float-significand-byte bits))) (or (not (zerop (ldb vm:double-float-significand-byte hi))) (not (zerop lo))) @@ -354,8 +355,8 @@ #+double-double (float-nan-p (double-double-hi x))) - (frob float-trapping-nan-p - "Return true if the float X is a trapping NaN (Not a Number)." + (frob float-signaling-nan-p + "Return true if the float X is a signaling NaN (Not a Number)." (zerop (logand (ldb vm:single-float-significand-byte bits) vm:single-float-trapping-nan-bit)) (zerop (logand (ldb vm:double-float-significand-byte hi) @@ -364,8 +365,12 @@ (zerop (logand (ldb vm:long-float-significand-byte hi) vm:long-float-trapping-nan-bit)) #+double-double - (float-trapping-nan-p (double-double-hi x)))) + (float-signaling-nan-p (double-double-hi x)))) +(declaim (inline float-trapping-nan-p)) +(defun float-trapping-nan-p (x) + "Deprecated. Use FLOAT-SIGNALING-NAN-P instead." + (float-signaling-nan-p x)) ;;; FLOAT-PRECISION -- Public ;;; @@ -928,7 +933,7 @@ ;; Infinity is infinity, no matter how small... x) ((float-nan-p x) - (when (and (float-trapping-nan-p x) + (when (and (float-signaling-nan-p x) (vm:current-float-trap :invalid)) (error 'floating-point-invalid-operation :operation 'scale-float :operands (list x exp))) diff --git a/src/code/print.lisp b/src/code/print.lisp index f2a1205db7697da2e7f5c00dec7d14a1b7d52253..778d82772828711402b80e48ddc312e0fb5352c6 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -1732,7 +1732,7 @@ radix-R. If you have a power-list then pass it in as PL." (defun output-float-nan (x stream) (print-unreadable-object (x stream) (write-string (float-format-name x) stream) - (write-string (if (float-trapping-nan-p x) " Trapping" " Quiet") stream) + (write-string (if (float-signaling-nan-p x) " Signaling" " Quiet") stream) (write-string " NaN" stream))) diff --git a/src/general-info/release-20f.txt b/src/general-info/release-20f.txt index 7179f1f0776ea718a1d6a27c6bc4e7843cdf6553..14c64b8ce51174bef831d594a08af73b5cec4782 100644 --- a/src/general-info/release-20f.txt +++ b/src/general-info/release-20f.txt @@ -64,6 +64,10 @@ New in this release: CMUCL will not run on chips without SSE2 anymore. * (cosh 1000d0) signals an overflow error as it should. Previously, it just incorrectly returned infinity. + * Deprecating FLOAT-TRAPPING-NAN-P in favor of + FLOAT-SIGNALING-NAN-P. + * Changed the printer to print "Signaling" instead of "Trapping" + when printing a signaling NaN. * ANSI compliance fixes: * The values on the branch cuts for the inverse trig and diff --git a/src/i18n/locale/cmucl.pot b/src/i18n/locale/cmucl.pot index 15366ac6b749a2a1e8296cdeff2cc83d75490980..a88563494141155ef7c1fe04d74737a82e896551 100644 --- a/src/i18n/locale/cmucl.pot +++ b/src/i18n/locale/cmucl.pot @@ -4783,11 +4783,15 @@ msgid "Return true if the float X is an infinity (+ or -)." msgstr "" #: src/code/float.lisp -msgid "Return true if the float X is a NaN (Not a Number)." +msgid "Return true if the float X is a quiet or signaling NaN (Not a Number)." msgstr "" #: src/code/float.lisp -msgid "Return true if the float X is a trapping NaN (Not a Number)." +msgid "Return true if the float X is a signaling NaN (Not a Number)." +msgstr "" + +#: src/code/float.lisp +msgid "Deprecated. Use FLOAT-SIGNALING-NAN-P instead." msgstr "" #: src/code/float.lisp