Skip to content

Commit

Permalink
Merge pull request #284 from Aimarekin/main
Browse files Browse the repository at this point in the history
Make NaN similar to itself
  • Loading branch information
dphfox authored Oct 15, 2023
2 parents ce5ba5f + 695637b commit ebaf850
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Utility/isSimilar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ local function isSimilar(a: any, b: any): boolean
if typeof(a) == "table" then
return false
else
return a == b
-- NaN does not equal itself but is the same
return a == b or a ~= a and b ~= b
end
end

return isSimilar
return isSimilar

0 comments on commit ebaf850

Please sign in to comment.