source: trunk/source/tests/ansi-tests/exp.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.7 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Sep  1 21:24:44 2003
4;;;; Contains: Tests of EXP
5
6(in-package :cl-test)
7
8(compile-and-load "numbers-aux.lsp")
9(compile-and-load "exp-aux.lsp")
10
11;;; Error tests
12
13(deftest exp.error.1
14  (signals-error (exp) program-error)
15  t)
16
17(deftest exp.error.2
18  (signals-error (exp 0 nil) program-error)
19  t)
20
21(deftest exp.error.3
22  (signals-error (exp 0 0 0) program-error)
23  t)
24
25;;; Other tests
26
27(deftest exp.1
28  (let ((result (exp 0)))
29    (or (eqlt result 1)
30        (eqlt result 1.0f0)))
31  t)
32
33(deftest exp.2
34  (mapcar #'exp '(0.0s0 0.0f0 0.0d0 0.0l0))
35  (1.0s0 1.0f0 1.0d0 1.0l0))
36
37(deftest exp.3
38  (mapcar #'exp '(-0.0s0 -0.0f0 -0.0d0 -0.0l0))
39  (1.0s0 1.0f0 1.0d0 1.0l0))
40
41;;; FIXME
42;;; Add more tests here for floating point accuracy
43
44(deftest exp.error.4
45  (signals-error (exp (+ (log most-positive-short-float) 100))
46                 floating-point-overflow)
47  t)
48
49(deftest exp.error.5
50  (signals-error (exp (+ (log most-positive-single-float) 100))
51                 floating-point-overflow)
52  t)
53
54(deftest exp.error.6
55  (signals-error (exp (+ (log most-positive-double-float) 100))
56                 floating-point-overflow)
57  t)
58
59(deftest exp.error.7
60  (signals-error (exp (+ (log most-positive-long-float) 100))
61                 floating-point-overflow)
62  t)
63
64(deftest exp.error.8
65  (signals-error (exp (- (log least-positive-short-float) 100))
66                 floating-point-underflow)
67  t)
68
69(deftest exp.error.9
70  (signals-error (exp (- (log least-positive-single-float) 100))
71                 floating-point-underflow)
72  t)
73
74(deftest exp.error.10
75  (signals-error (exp (- (log least-positive-double-float) 100))
76                 floating-point-underflow)
77  t)
78
79(deftest exp.error.11
80  (signals-error (exp (- (log least-positive-double-float) 100))
81                 floating-point-underflow)
82  t)
Note: See TracBrowser for help on using the repository browser.