Fixes round-off error in sqrt.
This commit is contained in:
parent
d9cdcb8959
commit
f7dcbe87c6
|
@ -1914,7 +1914,13 @@
|
||||||
(let ([v (sqrt (inexact x))])
|
(let ([v (sqrt (inexact x))])
|
||||||
;;; could the [dropped] residual ever affect the answer?
|
;;; could the [dropped] residual ever affect the answer?
|
||||||
(cond
|
(cond
|
||||||
[(infinite? v) (inexact s)]
|
[(infinite? v)
|
||||||
|
(if (bignum? s)
|
||||||
|
(foreign-call "ikrt_bignum_to_flonum"
|
||||||
|
s
|
||||||
|
1 ;;; round up in case of a tie
|
||||||
|
($make-flonum))
|
||||||
|
(inexact s))]
|
||||||
[else v]))]))]
|
[else v]))]))]
|
||||||
[(ratnum? x)
|
[(ratnum? x)
|
||||||
;;; FIXME: incorrect as per bug 180170
|
;;; FIXME: incorrect as per bug 180170
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1339
|
1340
|
||||||
|
|
Loading…
Reference in New Issue