Once, twice, thrice... ?

I always had this preconception that anything divided by 0 would equal 0.

simple as that.

Zero is about as far from a reasonable answer you can get. As x approaches zero 1/x approaches infinity. Or if you have a negative number it approaches negative infinity. Either of those might be reasonable to think of it if you're not speaking in strictly math laws. In reality a division by zero is undefined. This is because you could easily break all mathematical rules if you attempted to divide by zero. For instance, if x = 0, then this equation holds:
3x = 5x
So we divide by x, and this is what we get left with:
3 = 5
Clearly nonsense, caused by division by zero.
 
how do C compilers treat an accidental division by 0?
If it's a division by a constant 0, you'll get a compile time error.

IEEE floating point can have special "values" that represent an error that occurred. This "value" is then sent through further calculations.
1.0/+0.0 = +INF = +infinity
-1.0/+0.0 = -INF = -infinity
0.0/0.0 = NAN = Not A Number

I think you can catch it with exceptions if you want to. (Not C++ exceptions, but a kind of interrupts.)

With integers, you'll also get an exception, that typically give you the "Please tell Microsoft about this problem"-popup.
 
Clearly nonsense, caused by division by zero.
Hey that was a great and educational post. Thank you.

Wish all math could have been that clear-cut (or at least explained as well) when I was i nschool. Would have saved me a lot of bother. :cool:

Peace.
 
No, in maths the term "limes" is used around here specifically when you search for the limits of an infinite raw sums or such. Just a language thing.
Interesting. Doesn't appear to be used in English though.
 
Well, it doesn't actually matter... both are accepted like "while" and "whilst".

You could try to use it as an adjective and IMO, "math homework" sounds better than "maths homework". Plus I'm lazy, and making the effort to pronounce that "ths" makes me want to add it to every wordths thaths thoundths fun.


;)
 
Back
Top