Back in my C programming days I thought there was a constant or function (I can't remember what it was called, let's call it SMALL
) whose value was the smallest possible positive value. (Imagine the LSB=1 and all other bits = 0.) It was used to avoid a divide by zero error.
For example, let's say you want to compute z = x/y
. Then you could calculate
z = x / (y + SMALL);
Is there a built-in function in MS EXCEL that implements SMALL
? For that matter, does it exist in C/C++ or am I going crazy?
y == -SMALL
? As others have said, using this to avoid division by zero is a horrifically bad idea, and is a good sign that you need to rethink what you're doing.