News for hackers. Stuff that matters.
Re:Common Lisp: Numbers by reikonomusha on Friday June 14, 2019 @03:52PM (#20186159)
The notion of "by itself" is dubious in this context at best. You can only check up to finite precision that two numbers are equal. For something more, you need computer algebra, which is a tall order.

Even if you have computer algebra, math says it's not possible to check that arbitrary expressions are equal. It's an undecidable problem. So with that, I don't fault a computable reals package not being able to detect that x == y in an expression x/y.

Re:Common Lisp: Numbers by gjm11 on Friday June 14, 2019 @06:30PM (#20187188)
You can imagine an infinite-precision-real package that checks whether numerator and denominator are the exact same object and optimizes that case away.

(And I wonder idly from time to time about making one that does know a bit about some particularly nice classes of number -- e.g., algebraic numbers -- and does all the things you'd like it to as long as you stay within such a class. Obviously as soon as you ask it for sqrt(2)+pi all that would go out the window.)