I like the explanation of how Rats solve a class of rounding errors,
0.3 - (0.2 + 0.1) equals exactly 0 for example. On the other hand,
it's still a compromise that's shifting closer to correctness, fixing
a bunch of potential bugs, but not all in that class:

Rakudo:
> say 2 - (sqrt 2) ** 2
-4.44089209850063e-016

That's OK by me. I can also envision a type  which can perfectly
represent trigonometric and polynomial roots (backed by a symbolic
math package?), that would solve this problem. I can see why that
might be good in the core, for the same reasons that Rats are... or
maybe put them in a module, along with non-integer exponents and trig
functions, so if you can use functions with irrational numbers in
their domain, you also get the numeric types that can perfectly
represent them.

-y

Reply via email to