Hacker News new | ask | show | jobs
by dahfizz 1466 days ago
Rationals have their own set of issues:

1) it's really slow slow. Adding two fractions involves three integer multiplications and then running the GCD to simplify the fractions.

2) just simply comparing two rational numbers involves multiplication, which may overflow.

3) you can't represent irrational numbers. You can't do square roots, for example.

1 comments

Yes, all systems will have some drawbacks. My response was only geared towards this part:

> numbers like 1/10 and 1/3 can only be approximated in a finite number of bits

Maybe I should have been more explicit.