mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
Updating R7RS tests to allow exact results from transcendental functions.
Patch from Takashi Kato. Fixes issue #218.
This commit is contained in:
parent
ea6e44f7d0
commit
ca0cc6cb51
1 changed files with 9 additions and 7 deletions
|
@ -759,20 +759,20 @@
|
|||
(test 1/3 (rationalize (exact .3) 1/10))
|
||||
(test #i1/3 (rationalize .3 1/10))
|
||||
|
||||
(test 1.0 (exp 0))
|
||||
(test 1.0 (inexact (exp 0))) ;; may return exact number
|
||||
(test 20.0855369231877 (exp 3))
|
||||
|
||||
(test 0.0 (log 1))
|
||||
(test 0.0 (inexact (log 1))) ;; may return exact number
|
||||
(test 1.0 (log (exp 1)))
|
||||
(test 42.0 (log (exp 42)))
|
||||
(test 2.0 (log 100 10))
|
||||
(test 12.0 (log 4096 2))
|
||||
|
||||
(test 0.0 (sin 0))
|
||||
(test 0.0 (inexact (sin 0))) ;; may return exact number
|
||||
(test 1.0 (sin 1.5707963267949))
|
||||
(test 1.0 (cos 0))
|
||||
(test 1.0 (inexact (cos 0))) ;; may return exact number
|
||||
(test -1.0 (cos 3.14159265358979))
|
||||
(test 0.0 (tan 0))
|
||||
(test 0.0 (inexact (tan 0))) ;; may return exact number
|
||||
(test 1.5574077246549 (tan 1))
|
||||
|
||||
(test 0.0 (asin 0))
|
||||
|
@ -1714,8 +1714,10 @@
|
|||
(f + 10)))
|
||||
|
||||
(test 1024 (eval '(expt 2 10) (environment '(scheme base))))
|
||||
(test 0.0 (eval '(sin 0) (environment '(scheme inexact))))
|
||||
(test 1024.0 (eval '(+ (expt 2 10) (sin 0))
|
||||
;; (sin 0) may return exact number
|
||||
(test 0.0 (inexact (eval '(sin 0) (environment '(scheme inexact)))))
|
||||
;; ditto
|
||||
(test 1024.0 (eval '(+ (expt 2 10) (inexact (sin 0)))
|
||||
(environment '(scheme base) '(scheme inexact))))
|
||||
|
||||
(test-end)
|
||||
|
|
Loading…
Add table
Reference in a new issue