/[gcl]/gcl/ansi-tests/numbers-aux.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/numbers-aux.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by pfdietz, Tue Aug 5 02:30:18 2003 UTC revision 1.5 by pfdietz, Sat Aug 9 18:13:35 2003 UTC
# Line 126  Line 126 
126                unless (and (<= m x) (<= m y)                unless (and (<= m x) (<= m y)
127                            (or (= m x) (= m y)))                            (or (= m x) (= m y)))
128                collect (list x y m))))                collect (list x y m))))
129    
130    (defun random-nonnegative-real ()
131      (if (coin 3)
132          (random-case
133           (/ (random 10000) (1+ (random 1000)))
134           (/ (random 1000000) (1+ (random 100000)))
135           (/ (random 100000000) (1+ (random 10000000)))
136           (/ (random 1000000000000) (1+ (random 10000000))))
137        (random (random-case
138                 1000
139                 100000
140                 10000000
141                 1000000000
142                 (expt 2.0s0 (random 15))
143                 (expt 2.0f0 (random 32))
144                 (expt 2.0d0 (random 32))
145                 (expt 2.0l0 (random 32))))))
146    
147    (defun random-real ()
148      (if (coin) (random-nonnegative-real)
149        (- (random-nonnegative-real))))
150    
151    (defun epsilon (number)
152      (etypecase number
153        (short-float short-float-epsilon)
154        (single-float single-float-epsilon)
155        (double-float double-float-epsilon)
156        (long-float long-float-epsilon)
157        (rational 0)))
158    
159    (defun negative-epsilon (number)
160      (etypecase number
161        (short-float short-float-negative-epsilon)
162        (single-float single-float-negative-epsilon)
163        (double-float double-float-negative-epsilon)
164        (long-float long-float-negative-epsilon)
165        (rational 0)))
166    
167    
168    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26