fix R6RS log to accept 2 arguments
svn: r11197
This commit is contained in:
parent
ea8c4b3f38
commit
ebb811b491
|
@ -66,7 +66,7 @@
|
||||||
numerator denominator
|
numerator denominator
|
||||||
floor ceiling truncate round
|
floor ceiling truncate round
|
||||||
rationalize
|
rationalize
|
||||||
exp log sin cos tan asin acos atan
|
exp (rename-out [r6rs:log log]) sin cos tan asin acos atan
|
||||||
sqrt (rename-out [integer-sqrt/remainder exact-integer-sqrt])
|
sqrt (rename-out [integer-sqrt/remainder exact-integer-sqrt])
|
||||||
expt
|
expt
|
||||||
make-rectangular make-polar real-part imag-part magnitude
|
make-rectangular make-polar real-part imag-part magnitude
|
||||||
|
@ -296,6 +296,11 @@
|
||||||
args))
|
args))
|
||||||
(apply / args))]))
|
(apply / args))]))
|
||||||
|
|
||||||
|
(define r6rs:log
|
||||||
|
(case-lambda
|
||||||
|
[(n) (log n)]
|
||||||
|
[(n m) (/ (log n) (log m))]))
|
||||||
|
|
||||||
(define (r6rs:angle n)
|
(define (r6rs:angle n)
|
||||||
; because `angle' produces exact 0 for reals:
|
; because `angle' produces exact 0 for reals:
|
||||||
(if (and (inexact-real? n) (positive? n))
|
(if (and (inexact-real? n) (positive? n))
|
||||||
|
|
|
@ -842,6 +842,8 @@
|
||||||
(test/approx (log 2.718281828459045) 1.0)
|
(test/approx (log 2.718281828459045) 1.0)
|
||||||
(test (log +inf.0) +inf.0)
|
(test (log +inf.0) +inf.0)
|
||||||
(test (log 0.0) -inf.0)
|
(test (log 0.0) -inf.0)
|
||||||
|
(test/approx (log 100 10) 2.0)
|
||||||
|
(test/approx (log 1125899906842624 2) 50.0)
|
||||||
|
|
||||||
(test/exn (log 0) &assertion)
|
(test/exn (log 0) &assertion)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user