Skip to content

Commit

Permalink
Add missing decoder case for NaN (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieka authored Sep 4, 2024
1 parent b88063f commit c6c3c95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/bson/decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ defmodule BSON.DecoderGenerator do
{:NaN, rest}
end

defp type(@type_float, <<0, 0, 0, 0, 0, 0, 248::little-integer-size(8), 255::little-integer-size(8), rest::binary>>) do
{:NaN, rest}
end

defp type(@type_float, <<1, 0, 0, 0, 0, 0, 240::little-integer-size(8), 127::little-integer-size(8), rest::binary>>) do
{:NaN, rest}
end
Expand Down

0 comments on commit c6c3c95

Please sign in to comment.