source: trunk/source/tests/ansi-tests/fround-aux.lsp @ 8991

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

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

File size: 567 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Aug 21 16:08:55 2003
4;;;; Contains: Aux. functions for testing FROUND
5
6(in-package :cl-test)
7
8(defun fround.1-fn ()
9  (loop for n = (- (random 200000)
10                   100000)
11        for d = (1+ (random 10000))
12        for vals = (multiple-value-list (fround n d))
13        for (q r) = vals
14        for n2 = (+ (* q d) r)
15        repeat 100
16        unless (and (eql (length vals) 2)
17                    (floatp q)
18                    (= n n2)
19                    (integerp r)
20                    (<= (- (/ d 2)) r (/ d 2))
21                    (or (/= (abs r) (/ d 2))
22                        (evenp (floor q))))
23        collect (list n d q r n2)))
24
25
Note: See TracBrowser for help on using the repository browser.