I think we're speaking about 2 different things here:
1. Multiplying by the inverse of a number: I applied this "trick" when memory was measured in bytes and I needed to save memory. However, that trick requires that you know the numbers (constants) beforehand:
Code:
flow (gpm) = flow (mgd) * .00069444
You can write this equation because you know that .00069444 = 1/1440.
2. OP wrote:
I divide a bunch of variables by total plant flow to work out pump speed.
So the equation is some_variables/flow. If flow is zero, you get a math error. I suppose that some_variables * (1/flow) will give an error when flow is zero.
Said that, I agree with others members that it's necessary to place a compare block before the calculation. I prefer GRT block (never use EQU or NEQ with real numbers, and I suppose that flow is a real).
Also, in the equation some_variables/flow, if some_variables is too high and flow is too low, the equation could throw an overflow error. That's something to take in account.
Thanks for all the input guys, really appreciate it. I'm gonna try the bypass of the compute instruction if the flow is equal to 0 and set the value. Shouldn't be too hard, thanks for pointing me in the right direction.