3 ms·
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 ev
by rollcat 1y ago
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.
- inglor_cz 1y agoYeah, 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.
- isoprophlex 1y agoWell, now in this brave new age of AI we can enjoy computer programs crashing with an Error: division by please upvote, share and like!
- xyproto 1y agoThis also works; I upvoted your comment.
- o1bf2k25n8g5 1y agoI have discovered a truly marvelous proof of how to smash that like and subscribe button, which this comment box is too small to contain.
- edwcross 1y agoIn 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).
- KeplerBoy 1y agoDenormals are flushed to zero by default on most GPUs by the way.
- rollcat 1y agoMakes 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?)