Skip to content

Commit 71a75a6

Browse files
authored
Merge pull request #52 from jmkuhn/e
Fix rounding error
2 parents 077ff80 + 208d2fb commit 71a75a6

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)