| ... |
... |
@@ -8,14 +8,23 @@ |
|
8
|
8
|
(defparameter *qnan*
|
|
9
|
9
|
(ext:with-float-traps-masked (:invalid)
|
|
10
|
10
|
(* 0 ext:double-float-positive-infinity))
|
|
11
|
|
- "Some randon quiet MaN value")
|
|
|
11
|
+ "Some randon quiet double-float MaN value")
|
|
|
12
|
+
|
|
|
13
|
+(defparameter *qnan-single-float*
|
|
|
14
|
+ (ext:with-float-traps-masked (:invalid)
|
|
|
15
|
+ (* 0 ext:single-float-positive-infinity))
|
|
|
16
|
+ "Some randon quiet single-float MaN value")
|
|
12
|
17
|
|
|
13
|
18
|
(defparameter *snan*
|
|
14
|
19
|
(kernel:make-double-float #x7ff00000 1)
|
|
15
|
|
- "A randon signaling MaN value")
|
|
|
20
|
+ "A randon signaling double-float MaN value")
|
|
|
21
|
+
|
|
|
22
|
+(defparameter *snan-single-float*
|
|
|
23
|
+ (kernel:make-single-float #x7f800001)
|
|
|
24
|
+ "A randon signaling single-float MaN value")
|
|
16
|
25
|
|
|
17
|
26
|
(define-test %cosh.exceptions
|
|
18
|
|
- (:tag :fdlibm)
|
|
|
27
|
+ (:tag :fdlibm)
|
|
19
|
28
|
(assert-error 'floating-point-overflow
|
|
20
|
29
|
(kernel:%cosh 1000d0))
|
|
21
|
30
|
(assert-error 'floating-point-overflow
|
| ... |
... |
@@ -23,6 +32,10 @@ |
|
23
|
32
|
(assert-error 'floating-point-invalid-operation
|
|
24
|
33
|
(kernel:%cosh *snan*))
|
|
25
|
34
|
(assert-true (ext:float-nan-p (kernel:%cosh *qnan*)))
|
|
|
35
|
+ (assert-error 'floating-point-overflow
|
|
|
36
|
+ (kernel:%cosh ext:double-float-positive-infinity))
|
|
|
37
|
+ (assert-error 'floating-point-overflow
|
|
|
38
|
+ (kernel:%cosh ext:double-float-negative-infinity))
|
|
26
|
39
|
|
|
27
|
40
|
;; Same, but with overflow's masked
|
|
28
|
41
|
(ext:with-float-traps-masked (:overflow)
|
| ... |
... |
@@ -38,6 +51,34 @@ |
|
38
|
51
|
(ext:with-float-traps-masked (:invalid)
|
|
39
|
52
|
(assert-true (ext:float-nan-p (kernel:%cosh *snan*)))))
|
|
40
|
53
|
|
|
|
54
|
+(define-test %coshf.exceptions
|
|
|
55
|
+ (:tag :fdlibm)
|
|
|
56
|
+ (assert-error 'floating-point-overflow
|
|
|
57
|
+ (kernel:%coshf 100f0))
|
|
|
58
|
+ (assert-error 'floating-point-overflow
|
|
|
59
|
+ (kernel:%coshf -100f0))
|
|
|
60
|
+ (assert-error 'floating-point-invalid-operation
|
|
|
61
|
+ (kernel:%coshf *snan-single-float*))
|
|
|
62
|
+ (assert-true (ext:float-nan-p (kernel:%coshf *qnan-single-float*)))
|
|
|
63
|
+ (assert-error 'floating-point-overflow
|
|
|
64
|
+ (kernel:%coshf ext:single-float-positive-infinity))
|
|
|
65
|
+ (assert-error 'floating-point-overflow
|
|
|
66
|
+ (kernel:%coshf ext:single-float-negative-infinity))
|
|
|
67
|
+
|
|
|
68
|
+ ;; Same, but with overflow's masked
|
|
|
69
|
+ (ext:with-float-traps-masked (:overflow)
|
|
|
70
|
+ (assert-equal ext:single-float-positive-infinity
|
|
|
71
|
+ (kernel:%coshf 100f0))
|
|
|
72
|
+ (assert-equal ext:single-float-positive-infinity
|
|
|
73
|
+ (kernel:%coshf -100f0))
|
|
|
74
|
+ (assert-equal ext:single-float-positive-infinity
|
|
|
75
|
+ (kernel:%coshf ext:single-float-positive-infinity))
|
|
|
76
|
+ (assert-equal ext:single-float-positive-infinity
|
|
|
77
|
+ (kernel:%coshf ext:single-float-negative-infinity)))
|
|
|
78
|
+ ;; Test NaN
|
|
|
79
|
+ (ext:with-float-traps-masked (:invalid)
|
|
|
80
|
+ (assert-true (ext:float-nan-p (kernel:%coshf *snan-single-float*)))))
|
|
|
81
|
+
|
|
41
|
82
|
(define-test %sinh.exceptions
|
|
42
|
83
|
(:tag :fdlibm)
|
|
43
|
84
|
(assert-error 'floating-point-overflow
|
| ... |
... |
@@ -47,6 +88,7 @@ |
|
47
|
88
|
(assert-error 'floating-point-invalid-operation
|
|
48
|
89
|
(kernel:%sinh *snan*))
|
|
49
|
90
|
(assert-true (ext:float-nan-p (kernel:%sinh *qnan*)))
|
|
|
91
|
+
|
|
50
|
92
|
;; Same, but with overflow's masked
|
|
51
|
93
|
(ext:with-float-traps-masked (:overflow)
|
|
52
|
94
|
(assert-equal ext:double-float-positive-infinity
|