Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does dividing neg # by 0 return *******
Message
De
27/06/2002 15:59:35
 
 
À
27/06/2002 15:48:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00673060
Message ID:
00673063
Vues:
21
>Does anyone know why I get a series of ****** when I divide a negative number by 0 instead of a zero as in the code below.
>
>?-1/0
> or
>x=-1
>y=0
>?x/y
>
>Yet when I turn it around and divide 0 by a negative number I always get a zero as expected.
>
>
>Keith Larsen

Basic math:

Any positive number divided by zero is +infinity (numeric overflow, or row of **** as you saw).
Any negative number divided by zero is -infinity
0/0 is undefined.

Zero divided by any non-zero number is always zero.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform