News for hackers. Stuff that matters.
Re:9999999999999999.0 – 9999999999999998.0 by bjourne on Saturday January 05, 2019 @07:12PM (#18835326)
That has not been my experience using a language with builtin support for rationals. The rational is simplified after each operation so it never grows unwieldy large. It is slower than floats, but imo vastly superior for most use cases.
Re:9999999999999999.0 – 9999999999999998.0 by johndough on Sunday January 06, 2019 @04:30AM (#18837440)
> The rational is simplified after each operation so it never grows unwieldy large.

We recently had an exponential memory growth bug because rationals can not always be simplified, for example if you start with (2/3) and repeatedly square it. Fortunately, this was not in user-facing code, so there was no chance of a denial-of-service attack, but that's definitely something to watch out for with rationals.

Re:9999999999999999.0 – 9999999999999998.0 by Retra on Sunday January 06, 2019 @01:05AM (#18836852)
"Most" use cases? You mean the use cases that don't involve heavy math, like graphics, physics, and statistics?
Re:9999999999999999.0 – 9999999999999998.0 by stephencanon on Sunday January 06, 2019 @07:09PM (#18841635)
Even simplifying after every operation, in the typical case exact rationals grow exponentially in the number of terms in the computation. This means that either: (a) you cannot use them for any non-trivial computation. (b) you have to round them, in which case they are strictly worse than floating-point numbers because they have redundant representations and a very non-uniform distribution.