Skip to content

Commit

Permalink
Make floats with 'e' not treated as ints
Browse files Browse the repository at this point in the history
  • Loading branch information
tf2spi committed Dec 14, 2024
1 parent 8f2766c commit de1c0ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/exact_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ gb_internal ExactValue exact_value_float_from_string(String string) {
}
}

if (!string_contains_char(string, '.') && !string_contains_char(string, '-')) {
if (!string_contains_char(string, 'e') && !string_contains_char(string, 'E')
&& !string_contains_char(string, '.') && !string_contains_char(string, '-')) {
// NOTE(bill): treat as integer
return exact_value_integer_from_string(string);
}
Expand Down

0 comments on commit de1c0ee

Please sign in to comment.