News for hackers. Stuff that matters.
Re:0.30000000000000004 by WaldoDude on Monday December 02, 2019 @06:32PM (#21688292)
I’m not sure I follow. Isn’t it just two integer multiplications followed by a comparison.

a/b > x/y is the same as ay > xb

Assuming you don’t overflow your integer type.

Re:0.30000000000000004 by atq2119 on Monday December 02, 2019 @06:57PM (#21688451)
> Assuming you don’t overflow your integer type.

There's your answer :)

It's far too easy to overflow your integer type by simply adding a bunch of rationals whose denominators happen to be coprime, or just by multiplying rationals. For this reason, the vast majority of rational implementations use arbitrary precision integers, and of course arithmetic on those isn't constant time.