From c9b2bfbf82f8cd8f3807d9697ea97e918c2c7fbd Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Tue, 9 Jun 2009 11:49:04 +0200 Subject: [PATCH] Use si:trap-fpe also when computing the small and large constants --- src/lsp/numlib.lsp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lsp/numlib.lsp b/src/lsp/numlib.lsp index 5125c3b12..2c86efd93 100644 --- a/src/lsp/numlib.lsp +++ b/src/lsp/numlib.lsp @@ -34,6 +34,7 @@ (epsilon- (x) (/= (float 1 x) (- (float 1 x) x)))) `(eval-when (compile load eval) + (let ((bits (si::trap-fpe 'last nil))) (defconstant short-float-epsilon ,(binary-search #'epsilon+ (coerce 0 'short-float) (coerce 1 'short-float)) "The smallest postive short-float E that satisfies @@ -65,7 +66,8 @@ (defconstant long-float-negative-epsilon ,(binary-search #'epsilon- (coerce 0 'long-float) (coerce 1 'long-float)) "The smallest positive long-float E that satisfies - (not (= (float 1 E) (- (float 1 E) E)))"))) + (not (= (float 1 E) (- (float 1 E) E)))") + (si::trap-fpe 'last nil)))) #+IEEE-FLOATING-POINT (locally