Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does dividing neg # by 0 return *******
Message
From
27/06/2002 15:59:35
 
 
To
27/06/2002 15:48:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00673060
Message ID:
00673063
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform