3 ms·
Easy questions but not obvious answers. What kind of error to raise? Do you return a NaN? Throw an exception? Both have their uses.
by pavlov 6y ago
Easy questions but not obvious answers.
What kind of error to raise? Do you return a NaN? Throw an exception? Both have their uses.
- darthrupert 6y agoThrow a standard exception. E.g. python calls it a ValueError. Returing NaN is clearly wrong design.