4 ms·
However, if you define a "null" number as 0, the summation works fine. Division by 0 can still fail, and that's good because the naïve coder will get a result l
by cratermoon 3y ago
However, if you define a "null" number as 0, the summation works fine. Division by 0 can still fail, and that's good because the naïve coder will get a result like NaN or, in some languages, undefined behavior, alerting them to the problem.
- arthurjj 3y ago>the summation works fine This is only true if that summation is not used or compared anywhere else which isn't usually the case. For example if in sql you are reporting the SUM(column_A)/ SUM(column_B) and one column can be null without the other one being null you're likely reporting the wrong number
- cratermoon 3y agoSo you're saying if you don't consistently use the same value to represent the value, you get incorrect results?