4 ms·
Yes, the numeric language does numeric things. But these examples of closed form solutions ignore that numbers on computers are not the usual mathematical objec
by hayley-patton 4y ago
Yes, the numeric language does numeric things. But these examples of closed form solutions ignore that numbers on computers are not the usual mathematical objects, rather having finite size and precision, and so it is hard to say immediately if these solutions using floating-point arithmetic provide the same precision. Of course the precision can be calculated and improved with analysis, still, but this falls under "it doesn't work but it's fast" territory (unless the limited precision is acceptable; I'd personally keep the result as a float then to expose that to the client of these functions).
I would be remiss not to mention the following story:
There is a story that Ken Iverson, the inventor of APL, was passing a terminal at which a Fortran programmer had just typed:
I = I+1
Ken paused for a moment, muttered “no it doesn’t”, and passed on.
- JBiserkov 4y agoCool story! Only way I = I + 1 is if I is infinity.
- hayley-patton 4y agoThere is some irony in juxtaposing a statement on floating point arithmetic before; I = I + 1 if I is a sufficiently large float.