primitivesuave 4 days ago

The UI is awesome, amazing work! However, arbitrary precision implies that there is no fixed upper limit to the number of digits - simple tests like `0.1 + 0.2 == 0.3` and `2^53 == 2^53 + 1` (both produce "false") indicates you're still using IEEE 754 double precision floats.

If "arbitrary precision" is not as important to you as "high precision", a 128 bit decimal has enough precision for 99% of real-world applications.

3
crap 4 days ago

Thanks for checking it out! Should have been more clear that this is actively being worked on. This is ultimately the goal, and I'm currently working on integrating `astro_float` as the base for numbers.

primitivesuave 4 days ago

That is awesome, I look forward to following the project and hopefully contributing! I became a better Rust programmer from reading your code :)

johannesrexx 3 days ago

Rewrite it like so

> 1/10 + 2/10 == 3/10 true >

jdhwosnhw 4 days ago

Do you mean, the first returns false and the second returns true?

primitivesuave 4 days ago

Ah you're right, thank you for pointing it out!

In the previous version of this comment (where I was still reading it incorrectly) I added a fun fact, that the significand of an IEEE 754 double-precision float is only allocated 52 bits, but the "hidden bit trick" provides an extra bit of precision when the normalized form starts with 1.