No, it should not be an error. If you’re making a calculator and your user enters 1/0, your program should not have the propensity to crash; the result should simply be NaN and you should choose how you display that result to your user.
fun fact: getting NaN from a numeric calculation is the error that you handle. if this wasn’t obvious, please don’t write code for anyone but yourself. hope this helps.
No, it should not be an error. If you’re making a calculator and your user enters 1/0, your program should not have the propensity to crash; the result should simply be NaN and you should choose how you display that result to your user.
You talk like error handling isn’t a thing.
fun fact: getting NaN from a numeric calculation is the error that you handle. if this wasn’t obvious, please don’t write code for anyone but yourself. hope this helps.
NaNis a primitive value, not anError.>> typeof 1 / "a" "number"