Open paultag opened 12 months ago
Good observation, you're probably right on the floating point thing.
At least that was definitely the case when the executor was written in TS, so likely is doing the same thing when it was ported to Rust.
I would bet it is due to 64 bit floating point numbers not being able to represent the number: reproducer
@alteous Ah yes, I had posted this elsewhere:
I /think/ my bug is that even ~fixed point numbers~ integers in KCL are floating point numbers, but I dropped this here so I don't forget to look into this tomorrow https://github.com/KittyCAD/modeling-app/issues/1022
After looking at it, I'm pretty sure integers are also floats in KCL, which I didn't realize!
I'm surprised they aren't "BigNums" Curious to think about why they aren't "BigNums" - at the same time, f64 should be sufficient enough for any real world engineering case I would think (and if not, f128). The actual calculation though should be the exact same if they both follow the IEEE floating point standard.
Given the following:
KCL evaluates to a close, but not identical, number
I reckon fixed point numbers are also floating point numbers - I'm filing this so I don't forget to look into this when I get some spare cycles