Obsolete
Status Update
Comments
pa...@gmail.com <pa...@gmail.com> #2
Well, some mathematicians can divide by zero ;-)
The floating point unit actually can divide by zero, since there is a special syntax/format to represent +infinity and -infinity in floating point numbers.
Many times it's better to actually return these values instead of throwing an exception. So actually I prefer the way android works (it's more scientific).
Afaik dividing a postive value with zero returns +inf, dividing a negative returns -inf, and dividing 0 with 0 returns NaN (not-a-number).
Of course the android calculator could add an extra check, and if the result is any of these values, then it could show an error message instead, but IMHO that would just hide some useful information.
The floating point unit actually can divide by zero, since there is a special syntax/format to represent +infinity and -infinity in floating point numbers.
Many times it's better to actually return these values instead of throwing an exception. So actually I prefer the way android works (it's more scientific).
Afaik dividing a postive value with zero returns +inf, dividing a negative returns -inf, and dividing 0 with 0 returns NaN (not-a-number).
Of course the android calculator could add an extra check, and if the result is any of these values, then it could show an error message instead, but IMHO that would just hide some useful information.
ne...@gmail.com <ne...@gmail.com> #3
"Well, some mathematicians can divide by zero ;-)"
Android's calculator shouldn't be made just for Chuck Norris.
Android's calculator shouldn't be made just for Chuck Norris.
ne...@gmail.com <ne...@gmail.com> #4
Except something divided by zero is not infinity.
Cause you need to be able to reverse it, 0*infinity would not result in the original number. (If 3/0=infinity, then 0*infinity=3, which it doesn't)
Infinity is the wrong answer.
An error message is the correct one.
Cause you need to be able to reverse it, 0*infinity would not result in the original number. (If 3/0=infinity, then 0*infinity=3, which it doesn't)
Infinity is the wrong answer.
An error message is the correct one.
[Deleted User] <[Deleted User]> #5
This covers the topic pretty well: http://en.wikipedia.org/wiki/Division_by_zero
The calculator app is following the IEEE754 approach (skip down to "in computer arithmetic"). Whether this approach is correct for a desk calculator is debatable.
The calculator app is following the IEEE754 approach (skip down to "in computer arithmetic"). Whether this approach is correct for a desk calculator is debatable.
vs...@gmail.com <vs...@gmail.com> #6
wk...@gmail.com <wk...@gmail.com> #7
Inf×0={1,2,3,...}
Glad humanity is evolving and more able to accept infinity as they do 0. The above equation looks like the big bang.
Glad humanity is evolving and more able to accept infinity as they do 0. The above equation looks like the big bang.
wk...@gmail.com <wk...@gmail.com> #8
3×0=0 and 0/3=0 and 0×0=0 but 0/0=err and (-1)^(1/2)=i... so why cant 3/0=inf... it even makes more sense than a square root of a negative. i am a lot more comfortable with inf as a number than i am with imaginary numbers. evolve.
fr...@gmail.com <fr...@gmail.com> #9
@libertyr What number would you have to multiply 0 by, to reach 3? Even adding 0 to itself an infinite number of times would still give 0. That would be one reason that division by 0 is undefined rather than infinity.
si...@gmail.com <si...@gmail.com> #10
Showing a ∄ ("there does not exist" symbol) would be better.
he...@gmail.com <he...@gmail.com> #11
The only reason this really should return an error is because you are not specifying whether it is +0.0f or -0.0f that is being divided. If the float assumes +0.0, then the result should be #inf, as displayed. If the float were supposed to be -0.0, then the result of X/-0.0f should be -#inf.
If you were dealing with real numbers, divide by zero is an error. Divide by X where X is lim->0, would be infinity.
If you were dealing with real numbers, divide by zero is an error. Divide by X where X is lim->0, would be infinity.
da...@gmail.com <da...@gmail.com> #12
(sorry for the necropost, I guess)
hexsmith, the user is not dividing by +0.0f or -0.0f, the user is dividing by zero. The user is not looking for the limit as x approaches zero from the right of 1/x, the user is dividing by zero.
It is absolutely, unambiguously incorrect for the calculator to give "Infinity" as an answer. It must throw an error, because in actual math (when you are not talking about transistors or anything), the rule is that you just aren't allowed to divide by zero.
Keith, the problem is not imagination, it's math. 3*0 = 0, that is correct. 0/0 is not allowed, that is correct. The square root of -1 is i. That is correct. 3/0 is not infinity. This is incorrect. This should throw an error. Mathematicians have officially decided that 3/0 is not allowed, and the Android Calculator shouldn't ignore that and give people the wrong answer. Case in point: you appear to have been misled into thinking it's not wrong.
hexsmith, the user is not dividing by +0.0f or -0.0f, the user is dividing by zero. The user is not looking for the limit as x approaches zero from the right of 1/x, the user is dividing by zero.
It is absolutely, unambiguously incorrect for the calculator to give "Infinity" as an answer. It must throw an error, because in actual math (when you are not talking about transistors or anything), the rule is that you just aren't allowed to divide by zero.
Keith, the problem is not imagination, it's math. 3*0 = 0, that is correct. 0/0 is not allowed, that is correct. The square root of -1 is i. That is correct. 3/0 is not infinity. This is incorrect. This should throw an error. Mathematicians have officially decided that 3/0 is not allowed, and the Android Calculator shouldn't ignore that and give people the wrong answer. Case in point: you appear to have been misled into thinking it's not wrong.
pi...@gmail.com <pi...@gmail.com> #13
If 5/0=Inf and 42/0=Inf that means that 5/0=42/0 which then means 5=42.
I like that maths, if I had know that back when I were in school that could have been real useful on any math test.
Just answer 42 on everything and then prove to your teacher that everything equals 42.
I like that maths, if I had know that back when I were in school that could have been real useful on any math test.
Just answer 42 on everything and then prove to your teacher that everything equals 42.
Description
DEVICE: Emulator
SUMMARY: Calculator shows infinity
REPRO STEPS:
1. Go to "MENU"
2. Choose "Calculator"
3. Enter 5÷0 (01.png)
4. Infinity result shows up (02.png)
EXPECTED RESULT:
Error message should be shown. You cannot divide by zero.
NOTE:
Few examples from Windows (Windows.png), Linux (Linux.png)