You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Float f=yylval.num;
f = atof(string_chars(float_buf));
When we should just Float f = atof(string_chars(float_buf));
Secondly, we can probably do away with the float_buf string and just track the start of the token and our current location and use strtof / strtod with the end-ptr set.
This would get rid of allocating and discarding a string for every integer and float token.
The text was updated successfully, but these errors were encountered:
When tokenizing a float, there are 2 issues:
First, we do this:
When we should just
Float f = atof(string_chars(float_buf));
Secondly, we can probably do away with the
float_buf
string and just track the start of the token and our current location and usestrtof
/strtod
with the end-ptr set.This would get rid of allocating and discarding a string for every integer and float token.
The text was updated successfully, but these errors were encountered: