Skip to content

Commit 47a96aa

Browse files
fix writeshortest for 0.0 when hash==false
1 parent 6f52a98 commit 47a96aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/ryu/shortest.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,10 @@ function writeshortest(buf::AbstractVector{UInt8}, pos, x::T,
250250
pos += 1
251251
end
252252
if precision == -1
253-
@inbounds buf[pos] = UInt8('0')
254-
pos += 1
253+
if hash
254+
@inbounds buf[pos] = UInt8('0')
255+
pos += 1
256+
end
255257
if typed && x isa Float32
256258
@inbounds buf[pos] = UInt8('f')
257259
@inbounds buf[pos + 1] = UInt8('0')

0 commit comments

Comments
 (0)