C
C#2y ago
plushechka

❔ 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
ero
ero2y ago
i see no division being done your inner try-catch is also... just weird
plushechka
plushechkaOP2y ago
the attempt is contained in in "case '=' "
ero
ero2y ago
again, i see no division being done
plushechka
plushechkaOP2y ago
one minute
ero
ero2y ago
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 zero
plushechka
plushechkaOP2y ago
thank 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
plushechka
plushechkaOP2y ago
plushechka
plushechkaOP2y ago
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server