Re: Suggestion for 2.5
- Posted by Martin Stachon <martin.stachon at worldonline.cz> Feb 19, 2003
- 448 views
rforno wrote: > When crunching numbers, sometimes one gets a "division by zero" error. In > such cases, perhaps the useful thing to do is assign "infinite" to the > result (I mean the IEEE standard infinite), so that if you use he result as > a divisor, the new result will be zero. The following are the results for > zero division I propose: > 1 / 0 = inf > -1 / 0 = -inf Given that 1 / 0 = inf, some of these expressions are indeterminate: (They can have any value. Sometimes, the program might expect 1, somtimes 0 would fit in the algorithm better.) > 0 / 0 = 1 Because x * 0 = 0 for any x, 0 / 0 can be anything. > inf / 0 = inf > -inf / 0 = -inf That could be right. (I am not sure) > inf / inf = 1 > -inf / inf = -1 > inf / -inf = -1 > -inf / -inf = 1 x * inf = inf, so inf / inf can be anything. (Try to cut down an infinite long straight line into infinite number of parts - they can have any length) > 1 / inf = 0 > -1 / inf = 0 > 1 / -inf = 0 > -1 / -inf = 0 That's right. Some other indeterminate forms are : inf*0 0^0 (although MS Windows Calculator says 0^0=1, my Casio says "Math error"1^inf inf^0 I do not think we should play such high math agmes in our exact math machines. All "normal" applications would get screwed up with inf results anyway and those few math programs can handle this in its own way. Fun could begin with quatum based computers... Martin (does not have a math degree [yet])