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
The code currently handles floats by using a 4096 buffer space. We can do better:
There are 2 main pieces to floats: mantissa + exponent. Both are known to be limited.
Max length should be max digits of mantissa + max digits of exponent + formatting flags
Thoughts on a limiting parser:
Fill up the buffer until mantissa is full
If mantissa is full, don't append into buffer. If we didn't see a decimal, keep accruing the digit overflow; this is going to append to the actual exponents.
If we find e, treat the next set of digits as exponents.
Toss this result weird monstrosity result into parseFloat
I believe parseFloat should handle all of these edge cases already, in which case it could possibly be adapted to understand a reader instead of just strings. So maybe we could push an update to stdlib.
The text was updated successfully, but these errors were encountered:
The code currently handles floats by using a 4096 buffer space. We can do better:
Thoughts on a limiting parser:
e
, treat the next set of digits as exponents.parseFloat
I believe
parseFloat
should handle all of these edge cases already, in which case it could possibly be adapted to understand areader
instead of just strings. So maybe we could push an update to stdlib.The text was updated successfully, but these errors were encountered: