Skip to content

Commit 8f67534

Browse files
authored
Merge pull request #1 from pavpanchekha/fix-ordinal
Correct for the odd offsetting that `math/bigfloat` does for exponents
2 parents 48b3a11 + bc549b8 commit 8f67534

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

private/mpfr.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@
135135
[(bfnan? x) (add1 (infinite-ordinal es sig))]
136136
[(bfinfinite? x) (infinite-ordinal es sig)]
137137
[else
138-
(define-values (c exp) (bigfloat->sig+exp x))
138+
(define-values (c exp*) (bigfloat->sig+exp x))
139+
(define exp (+ exp* (bigfloat-precision x)))
139140
(define expmin (sub1 (mpfr-get-emin)))
140141
(cond
141142
[(< exp expmin) ; subnormal

0 commit comments

Comments
 (0)