diff --git a/notes.lsp b/notes.lsp index cd2d484a98009a3165105da589065a4dbbd65297..cc05a00ec81eca1bec25f1c42e54f7edf4dc01a9 100644 --- a/notes.lsp +++ b/notes.lsp @@ -50,6 +50,14 @@ If negative zeros are distinct this is probably not good, since it makes (defcon "Assume that the values of iteration values in LOOP's FINALLY clause are defined to never overstep the iteration limit.") +(defnote :no-floating-point-underflow-by-default + "Assume that the implementation purposefully does not conform to 12.1.4.3 by not signaling +FLOATING-POINT-UNDERFLOW by default. + +A reason for lack of conformance might be contradictory wording in the spec: +12.1.4.3 mentions that the errors should be signaled, while arithmetic +operations mention that they \"might signal\" the error.") + ;;; Haible disagrees with :result-type-element-type-by-subtype #+clisp (rt::disable-note :result-type-element-type-by-subtype) #+(or openmcl gcl ecl) (rt::disable-note :nil-vectors-are-strings) diff --git a/numbers/exp.lsp b/numbers/exp.lsp index 83ed9566621af6de2b189da0c94be6d258d518bc..c1c8eab96f3b24413e303dbe3672f7c7b530d50d 100644 --- a/numbers/exp.lsp +++ b/numbers/exp.lsp @@ -62,21 +62,25 @@ t) (deftest exp.error.8 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (exp (- (log least-positive-short-float) 100)) floating-point-underflow) t) (deftest exp.error.9 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (exp (- (log least-positive-single-float) 100)) floating-point-underflow) t) (deftest exp.error.10 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (exp (- (log least-positive-double-float) 100)) floating-point-underflow) t) (deftest exp.error.11 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (exp (- (log least-positive-double-float) 100)) floating-point-underflow) t) diff --git a/numbers/expt.lsp b/numbers/expt.lsp index 5bb1293db6ec8b78b63ab28f73bfc0408f585384..81099e96809ebb3ea726bb11b5d9a04a9c6253b8 100644 --- a/numbers/expt.lsp +++ b/numbers/expt.lsp @@ -36,18 +36,22 @@ t) (deftest expt.error.8 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (expt least-positive-short-float 2) floating-point-underflow) t) (deftest expt.error.9 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (expt least-positive-single-float 2) floating-point-underflow) t) (deftest expt.error.10 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (expt least-positive-double-float 2) floating-point-underflow) t) (deftest expt.error.11 + :notes (:no-floating-point-underflow-by-default :ansi-spec-problem) (signals-error (expt least-positive-long-float 2) floating-point-underflow) t)