❔ Help with realization Division by zero in wpf project
I want to throw out the error when dividing by zero. Since
"Compute" gives infinity when divided by zero. I tried to do it through "Contains", but then it will be impossible to divide by decimal numbers
9 Replies
i see no division being done
your inner try-catch is also... just weird
the attempt is contained in in "case '=' "
again, i see no division being done
one minute
if you want to see whether an input is exactly zero, do
float.TryParse
, no?
if it returns false, it's not a number in the first place
if it returns true, and the result is 0
, then it's a zerothank you, i'm trying
maybe I misunderstood, but he forbids sharing, it's cool. However, when dividing by a decimal number, it also gives an error
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.