Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I was taught mathematics, the zero value was always considered the most important edge case. You prove something for N=0 (or N=1), then for N=M+1.

It's even more important in audio DSP: processing near-zeroes can end up being extremely CPU intensive, look up denormal/subnormal floats.



Yeah, I studied mathematics (algebra and number theory) and zero is the point, often sporting discontinuities, or weird asymptotic behavior.

Quite a lot of algorithms use some form of division and zero is the only number in our typical structures (Z, Q, R, C), that cannot be used to divide with.


In machine integer arithmetics, one must also beware division by -1, which can convert MIN_INT into MIN_INT with a signed overflow and violate some arithmetics invariants, such as sign (negative divided by negative is _usually_ positive).


Well, now in this brave new age of AI we can enjoy computer programs crashing with an

    Error: division by please upvote, share and like!


This also works; I upvoted your comment.


I have discovered a truly marvelous proof of how to smash that like and subscribe button, which this comment box is too small to contain.


Signed by Pierre de FermAIt


NaN


Denormals are flushed to zero by default on most GPUs by the way.


Makes total sense, execution time is bounded. The point is it's still a case you must consider (what if near-zero is distinct from zero and significant?)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: