Thursday - April 21, 2005
what is 1 divided by 0?

A thread on webmaster world poses a question I had several months ago but never found a clear answer for.

The question is simple, but the answer is more complicated.

What is 1 divided by 0?

According to Google’s calculator, it’s 0, but I think they’re right out. The two answers I had found were infinity and undefined (or error).

As an experiment, I decided to try it on all the calculators I could get my hands on:

The unix desk calculator (dc): divide by zero
Gnome’s calculator (gnome-calculator): inf
KDE’s calculator (kcalc): error
My HP 48G: Error: infinite result
My palm pilot: error

So that’s 3 votes for error and 2 for infinity.

Next, I tried various programming languages:

Perl: Illegal division by zero
PHP: Division by zero
Bash shell: division by zero
C/C++: division by zero
Java: / by zero
Python: ZeroDivisionError: integer division or modulo by zero

With all 6 being errors, it looks like programmers have decided you’re not allowed to do it.

That makes a total of 9 votes for undefined (or error) and 2 votes for infinity, so undefined is the big winner.

If you’re still not satisfied, you can find more on the subject by searching Google for divide by zero.







# of readers
- home
meta
comics
news links
other links

about me
blog archives
docs
entertainment
experiences
funny lists
humor
intellectual
interests
mefi
music
opinions
photos
web designs
tools
webmaster help

Sign up
Enter your e-mail address below to be notified of new posts:



Calendar
April 2005
S M T W T F S
« Mar   May »
 12
3456789
10111213141516
17181920212223
24252627282930




Search

  


Random quote
(View all quotes)
"I am always doing that which I cannot do, in order that I may learn how to do it."










Licensed under Creative Commons
(?) Choose theme:  X X X X X X


Loaded in 0.1105 seconds