We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04baaf3 commit 783608aCopy full SHA for 783608a
src/fmtcore.jl
@@ -333,7 +333,7 @@ end
333
334
function _pfmt_g(out::IO, fs::FormatSpec, x::AbstractFloat)
335
# Branch according to the exponent
336
- expnt = floor(Int, log10(abs(x)) )
+ expnt = x == 0 ? 0 : floor(Int, log10(abs(x)) )
337
if -4 <= expnt < fs.prec
338
newprec = fs.prec - expnt - 1
339
_pfmt_f(out, FormatSpec(fs ;prec=newprec), x)
0 commit comments