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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top