News for hackers. Stuff that matters.
Re:0.30000000000000004 by nneonneo on Sunday April 02, 2017 @05:05PM (#14019044)
It's great that your language of choice has fraction support - but real-world engineering problems rarely involve simple rational fractions exclusively. At some point you're going to run into roundoff error.

Plus, fractional computing has severe problems with expanding denominators, which grow very quickly with non-trivial operands. Although computers are fast, the overhead of dealing with hundred-digit-long arbitrary precision integers eventually makes rationals unwieldy.

Re:0.30000000000000004 by pg314 on Sunday April 02, 2017 @05:33PM (#14019149)
It's a trade-off between speed and accuracy. Not all software deals with real-world engineering problems, and there are plenty of applications where you would prefer accuracy.

I'd rather make that trade-off myself than have the language decide for me. Most of the time I would start with correctness and if speed is needed and the profiler shows that the bottleneck lies in fractional arithmetic, I'll switch to floating point numbers.

A similar trade-off exists with bignums versus 32 or 64 bit integers. There again, I prefer a language that uses bignums by default. I'll convert the bottlenecks to use fixnums after I've verified that it is safe to do so.

Re:0.30000000000000004 by Johnny_Brahms on Monday April 03, 2017 @01:56PM (#14025269)
With lisps you can chose whether you want floating point or rationals.