Skip to content

Commit

Permalink
grisu ignores n in SHORTEST mode, so _show needs to also
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Apr 17, 2015
1 parent 1aa67b7 commit c40bbc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/grisu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function _show(io::IO, x::FloatingPoint, mode, n::Int, typed, nanstr, infstr)
end
end
neg && write(io,'-')
if pt <= -4 || pt > 6 || pt >= n # .00001 to 100000.
if pt <= -4 || pt > 6 || (pt >= n && mode != SHORTEST) # .00001 to 100000.
# => #.#######e###
write(io, pdigits, 1)
write(io, '.')
Expand Down

0 comments on commit c40bbc6

Please sign in to comment.