Skip to content

Commit 208d2fb

Browse files
committed
Fix rounding error
1 parent 077ff80 commit 208d2fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fmtcore.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function _pfmt_e(out::IO, fs::FormatSpec, x::AbstractFloat)
226226
else
227227
rax = signif(ax, fs.prec + 1)
228228
e = floor(Integer, log10(rax)) # exponent
229-
u = rax / exp10(e) # significand
229+
u = rax * exp10(-e) # significand
230230
end
231231

232232
# calculate length

0 commit comments

Comments
 (0)