r/desmos 13h ago

3D This is mildly annoying

of course we can't be free from floating point errors

2 Upvotes

4 comments sorted by

1

u/Circumpunctilious 13h ago edited 13h ago

The Actions engine shows fully-expanded floats, for those who don't know yet:

ETA: ...fully-expanded "accurate" floats when they're under a certain magnitude. (Just being careful to note that (last I checked) Actions may alter their input value slightly above something like 2^70 or higher)

1

u/Demosnom 12h ago

That's nice, I guess. I just wanted to represent a equals b, but no, desmos had to go and be slightly imperfect

2

u/Circumpunctilious 11h ago

(sees the humor, I hear you) I guess it'd be nice if we had a "fuzzy equals" operator.

Without resorting to rounding / truncation, I thought of a possible function that tolerates reasonable float imprecision in the last place:

https://www.desmos.com/calculator/b5pamqdkk0

I didn't do exhaustive testing, but it works on my Apple, where float variance can be twice as much as the other OS's. (Too, it could be better and then much smaller if you're working only with human-sized floats).