The Eisel-Lemire algorithm is an effecient way to handle converting to
floating point numbers from strings, but in its base form it only
supports up to 64 bit floating point numbers. This adds an
implementation to handle long doubles.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/__support/str_to_float.h | ||
---|---|---|
253 | I'm not sure if I understand the comment here. |
libc/src/__support/str_to_float.h | ||
---|---|---|
253 | msb is just the most significant bit of final_approx_upper (as assigned on line 248), so 1 ^ msb is equivalent to !msb |
libc/src/__support/str_to_float.h | ||
---|---|---|
253 | Nvm, I was confused because in line 248, msb was right shifted by (BITS_IN_MANTISSA - 1), and I thought that BITS_IN_MANTISSA was the mantissa length, which might lead to msb > 1, and hence 1 ^ msb is not the same as !msb. But actually, BITS_IN_MANTISSA = 128, and so msb is either 0 or 1, and thus 1 ^ msb = 1 - msb. | |
libc/test/src/__support/str_to_float_test.cpp | ||
301 | Is there any test for this #else clause? |
I'm not sure if I understand the comment here.