4 / 0 is ok?

  • Thread starter Thread starter Guest
  • Start date Start date
clara said:
Why 4 / 0 is OK in VB.net

Read the documentation topic "/ operator [Visual Basic]". It contains a
section targetting division by zero.
 
clara said:
Hi all,

Why 4 / 0 is OK in VB.net

clara

thank you so much for your help

The / operator always converts the operands to Double. Dividing by zero
is not illegal for Doubles, so the result of 4 / 0 is
Double.PositiveInfinity.
 
Back
Top