summaryrefslogtreecommitdiffstats
path: root/r4rstest.scm
diff options
context:
space:
mode:
Diffstat (limited to 'r4rstest.scm')
-rw-r--r--r4rstest.scm48
1 files changed, 40 insertions, 8 deletions
diff --git a/r4rstest.scm b/r4rstest.scm
index f6f3ae0..7768f03 100644
--- a/r4rstest.scm
+++ b/r4rstest.scm
@@ -1,4 +1,4 @@
-;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003, 2004 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the
@@ -13,10 +13,14 @@
;; To receive a copy of the GNU General Public License, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA; or view
-;; http://swissnet.ai.mit.edu/~jaffer/GPL.html
+;; http://swiss.csail.mit.edu/~jaffer/GPL.html
-;;;; "r4rstest.scm" Test correctness of scheme implementations.
-;;; Author: Aubrey Jaffer
+;;;;"r4rstest.scm": Test R4RS correctness of scheme implementations.
+;;; Author: Aubrey Jaffer
+;;; Home-page: http://swiss.csail.mit.edu/~jaffer/Scheme
+;;; Current version: http://swiss.csail.mit.edu/ftpdir/scm/r4rstest.scm
+;;; CVS Head:
+;;; http://savannah.gnu.org/cgi-bin/viewcvs/scm/scm/r4rstest.scm?rev=HEAD&only_with_tag=HEAD&content-type=text/vnd.viewcvs-markup
;;; This includes examples from
;;; William Clinger and Jonathan Rees, editors.
@@ -478,6 +482,23 @@
(test #t exact? 3)
(test #f inexact? 3)
+;;(test 1 expt 0 0)
+(test 0 expt 0 1)
+(test 0 expt 0 256)
+;;(test 0 expt 0 -255)
+(test 1 expt -1 256)
+(test -1 expt -1 255)
+(test 1 expt -1 -256)
+(test -1 expt -1 -255)
+(test 1 expt 256 0)
+(test 1 expt -256 0)
+(test 256 expt 256 1)
+(test -256 expt -256 1)
+(test 8 expt 2 3)
+(test -8 expt -2 3)
+(test 9 expt 3 2)
+(test 9 expt -3 2)
+
(test #t = 22 22 22)
(test #t = 22 22)
(test #f = 34 34 35)
@@ -608,8 +629,18 @@
(test f1.0 round f0.8)
(test f4.0 round f3.5)
(test f4.0 round f4.5)
- (test 1 expt 0 0)
- (test 0 expt 0 1)
+
+ ;;(test f1.0 expt f0.0 f0.0)
+ ;;(test f1.0 expt f0.0 0)
+ ;;(test f1.0 expt 0 f0.0)
+ (test f0.0 expt f0.0 f1.0)
+ (test f0.0 expt f0.0 1)
+ (test f0.0 expt 0 f1.0)
+ (test f1.0 expt -25 f0.0)
+ (test f1.0 expt f-3.25 f0.0)
+ (test f1.0 expt f-3.25 0)
+ ;;(test f0.0 expt f0.0 f-3.25)
+
(test (atan 1) atan 1 1)
(set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely.
(set! load-test-obj (list 'define 'foo (list 'quote write-test-obj)))
@@ -757,7 +788,7 @@
(report-errs))
(define (test-numeric-predicates)
- (let* ((big-ex (expt 2 90))
+ (let* ((big-ex (expt 2 150))
(big-inex (exact->inexact big-ex)))
(newline)
(display ";testing bignum-inexact comparisons;")
@@ -1215,7 +1246,8 @@
(let ((have-inexacts?
(and (string->number "0.0") (inexact? (string->number "0.0"))))
(have-bignums?
- (let ((n (string->number "281474976710655325431")))
+ (let ((n (string->number
+ "1427247692705959881058285969449495136382746625")))
(and n (exact? n)))))
(cond (have-inexacts?
(test-inexact)