Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 15 Jul 2015 02:26 AM |
print(1/0) 1.#INF
Infinity?!? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 15 Jul 2015 02:28 AM |
"It's not. In arithmetic, as it is normally practiced, you can't divide by zero. The reason you can't do this is that 1/a=b is the same as ab=1. For the case a=0, we would need 0b=1. No such b is possible.
On computers, the IEEE floating point standard defines (roughly speaking) 1/0=infinity where infinity is a special sequence of bits. I've used this representation as a shorthand for a number bigger than any other number where I don't care what the actual value is. 1/a small number = a big bumber so it makes a perverse kind of sense for the IEEE to use this representation as the result of 1/0. But that's not standard in mathematics."
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2015 02:41 AM |
| anything divided by zero = infinity on a calculator |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 15 Jul 2015 02:44 AM |
>anything divided by zero = infinity on a calculator
Are you sure? Since I did this once:
(-0/0)
Error'd
|
|
|
| Report Abuse |
|
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
| |
|
|
| 15 Jul 2015 02:47 AM |
| 0 divided by anything is always 0, but anything else divided by 0 is infinite. Try to cut a cake in pieces until every piece has 0 size. You would have to cut infinite times. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Jul 2015 05:43 AM |
'0 divided by anything is always 0, but anything else divided by 0 is infinite' Nope, 0/0 is undefined and num/0 is not infinite, it's undefined. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 15 Jul 2015 05:48 AM |
You're reaching into the realms of imaginary numbers and undefined theoretical behaviours here.
Where num is not 0, according to computers: num/|0| is undefined, technically. num/+0 is +∞ num/-0 is -∞
Correct me if I'm wrong. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Jul 2015 05:55 AM |
Well, for the floating point standard, num/0 and num/+0 are the same in that way. Also -num/0 = -inf too. |
|
|
| Report Abuse |
|
|