Fixes more of bug 180170: (log (expt 2 1024)) now works.
This commit is contained in:
parent
af6562721b
commit
da7f05a538
|
@ -657,7 +657,9 @@
|
||||||
(string? (syntax->datum #'str))
|
(string? (syntax->datum #'str))
|
||||||
#'(let-syntax ([foo
|
#'(let-syntax ([foo
|
||||||
(lambda (t)
|
(lambda (t)
|
||||||
(list #'quote (pregexp-proc str)))])
|
(with-syntax ([c (datum->syntax #'_
|
||||||
|
(pregexp-proc str))])
|
||||||
|
#'(quote c)))])
|
||||||
foo)]
|
foo)]
|
||||||
[(_ args ...) #'(pregexp-proc args ...)]
|
[(_ args ...) #'(pregexp-proc args ...)]
|
||||||
[id (identifier? #'id) #'pregexp-proc])))
|
[id (identifier? #'id) #'pregexp-proc])))
|
||||||
|
|
|
@ -2076,7 +2076,9 @@
|
||||||
(cond
|
(cond
|
||||||
[(infinite? v) (inexact s)]
|
[(infinite? v) (inexact s)]
|
||||||
[else v]))]))]
|
[else v]))]))]
|
||||||
[(ratnum? x) (/ (sqrt ($ratnum-n x)) (sqrt ($ratnum-d x)))]
|
[(ratnum? x)
|
||||||
|
;;; FIXME: incorrect as per bug 180170
|
||||||
|
(/ (sqrt ($ratnum-n x)) (sqrt ($ratnum-d x)))]
|
||||||
[else (die 'sqrt "BUG: unsupported" x)])))
|
[else (die 'sqrt "BUG: unsupported" x)])))
|
||||||
|
|
||||||
(define flsqrt
|
(define flsqrt
|
||||||
|
@ -2252,8 +2254,19 @@
|
||||||
(cond
|
(cond
|
||||||
[(>= x 0) (foreign-call "ikrt_fl_log" x)]
|
[(>= x 0) (foreign-call "ikrt_fl_log" x)]
|
||||||
[else (die 'log "negative argument" x)])]
|
[else (die 'log "negative argument" x)])]
|
||||||
[(bignum? x) (log (exact->inexact x))]
|
[(bignum? x)
|
||||||
[(ratnum? x) (- (log (numerator x)) (log (denominator x)))]
|
;;; FIXME: incorrect as per bug 180170
|
||||||
|
(unless ($bignum-positive? x)
|
||||||
|
(die 'log "negative argument" x))
|
||||||
|
(let ([v (log (inexact x))])
|
||||||
|
(cond
|
||||||
|
[(infinite? v)
|
||||||
|
(let-values ([(s r) (exact-integer-sqrt x)])
|
||||||
|
(fl* 2.0 (log s)))]
|
||||||
|
[else v]))]
|
||||||
|
[(ratnum? x)
|
||||||
|
;;; FIXME: incorrect as per bug 180170
|
||||||
|
(- (log (numerator x)) (log (denominator x)))]
|
||||||
[else (die 'log "not a number" x)])))
|
[else (die 'log "not a number" x)])))
|
||||||
|
|
||||||
(define string->number
|
(define string->number
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1329
|
1330
|
||||||
|
|
Loading…
Reference in New Issue