Hacker News new | ask | show | jobs
by thesteamboat 1975 days ago
> We're still not comfortable checking if rationals are equal in any major language...

This seems to be confusing the issue to me. Checking for rational equality is trivial (just cross multiply). What we don't have is major languages deciding the the type rational numbers is useful enough to get first class support. And even that is overstating the issue, some languages do care and make representing rationals easy. In Julia, rational numbers can just be written like 2//3.

If people try to use floats to represent rationals and run into errors, the problem isn't that languages are incapable of representing rationals.

I don't see any upsides to using surreal numbers as a datatype. If you're restricting it to a finite size you're still going to have analagous problems that float or double do and I don't see any advantages in stability or whatever. If you're allowing arbitrary size (but obviously still finite) representation, you can still only represent the dyadic rationals, so you can't even express 1/3. The infinitesimals and infinities would require infinite size, so they're never practical.