Skip to content

Commit

Permalink
Clean up regex for NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Killgore committed Oct 4, 2022
1 parent 2da4c32 commit b3190e0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ private static object CastInteger(ulong number, TypeCode typeCode)
result = float.PositiveInfinity;
}
}
else if (Regex.IsMatch(v, @"^\.nan$|^\.NaN$|^\.NAN$")) //not a number
else if (Regex.IsMatch(v, @"^(\.nan|\.NaN|\.NAN)$")) //not a number
{
result = float.NaN;
}
Expand Down

0 comments on commit b3190e0

Please sign in to comment.