299 |
(floating-point-overflow () t)) |
(floating-point-overflow () t)) |
300 |
collect (list x y (min x y))))) |
collect (list x y (min x y))))) |
301 |
|
|
|
(defun epsilon (number) |
|
|
(etypecase number |
|
|
(complex (* 2 (epsilon (realpart number)))) ;; crude |
|
|
(short-float short-float-epsilon) |
|
|
(single-float single-float-epsilon) |
|
|
(double-float double-float-epsilon) |
|
|
(long-float long-float-epsilon) |
|
|
(rational 0))) |
|
|
|
|
|
(defun negative-epsilon (number) |
|
|
(etypecase number |
|
|
(complex (* 2 (negative-epsilon (realpart number)))) ;; crude |
|
|
(short-float short-float-negative-epsilon) |
|
|
(single-float single-float-negative-epsilon) |
|
|
(double-float double-float-negative-epsilon) |
|
|
(long-float long-float-negative-epsilon) |
|
|
(rational 0))) |
|
|
|
|
302 |
;;; Compute the number of digits that can be added to 1.0 in the appropriate |
;;; Compute the number of digits that can be added to 1.0 in the appropriate |
303 |
;;; float type, a rational representation of the smallest radix^(-k) s.t. |
;;; float type, a rational representation of the smallest radix^(-k) s.t. |
304 |
;;; 1.0 + radix^(-k) /= 1.0, and the float representation of that value. |
;;; 1.0 + radix^(-k) /= 1.0, and the float representation of that value. |