Skip to content

Commit

Permalink
include quotes in test when reading inf and nan strings
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Jan 31, 2025
1 parent 4fc6b43 commit 7f08318
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/read.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ function read!(buf, pos, len, b, tape, tapeidx, ::Type{String}; inf_mapping::Uni
end
@check
if inf_mapping !== nothing
val = view(buf, strpos:pos-1)
float = if val == codeunits(inf_mapping(Inf))[2:end-1]
val = view(buf, strpos-1:pos)
float = if val == codeunits(inf_mapping(Inf))
Inf
elseif val == codeunits(inf_mapping(-Inf))[2:end-1]
elseif val == codeunits(inf_mapping(-Inf))
-Inf
elseif val == codeunits(inf_mapping(NaN))[2:end-1]
elseif val == codeunits(inf_mapping(NaN))
NaN
else
0.0
Expand Down

0 comments on commit 7f08318

Please sign in to comment.