2 ms·
> 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
by johndough 8y ago
> 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.