
Mathamatical reasoning
Is it totaly impossible to Divide by 0?<BR><BR>Not just talking asp here, <BR>(altho one would think they would have written a function to handle it)...<BR><BR>But also referring to every darn piece of electronics....<BR><BR>There must be some deep reasoning behind it??<BR>

No.
IIRC, the result of dividing by 0 is infinity. <BR><BR>Bill can confirm or deny this for certain.

No such thing...
...now, there *is* mathEmatical reasoning. <snicker/><BR><BR>Yes, it's impossible to divide by zero.<BR><BR>Here's how to think of it:<BR><BR>What is the result of<BR> 1 / N<BR>as N gets smaller and smaller?<BR><BR>Consider:<BR> 1 / 1 >> 1<BR> 1 / 0.1 >> 10<BR> 1 / 0.00001 >> 100000<BR> 1 / 10^100 >> 10^+100 (a googol, a 1 with 100 zeroes after it)<BR> 1 / 10^1000000000 >> 10^+1000000000 (a 1 with a billion zeroes after it)<BR><BR>so the closer you get to zero, the larger the answer, right?<BR><BR>So zero is the smallest possible number. And 1 divided by zero is the largest possible number. And what do you thing the largest possible number is? The old answer used to be "infinity". Nowadays, we tend to say "undefined".<BR><BR>Anyway, suffice to say that there is no way to represent that largest possible number in a finite number of digits...or in a finite number of bits in a computer.<BR><BR>***********<BR><BR>It reminds me of a funny joke/idea I heard recently:<BR><BR>Remember the old song "99 bottles of beer on the wall"? It's fine, but it gets down to zero too quickly.<BR><BR>So try this variation:<BR><BR>"Infinity bottles of beer on the wall,<BR> Infinity bottles of beer!<BR> Take one down and pass it around, <BR> Infinity bottles of beer on the wall."<BR><BR>And that's because infinity minus any number is infinity. Yes, even infinity minus infinity is still infinity.<BR><BR><BR>

And just incidentally...
Let's say that 1/0 is *not* infinity.<BR><BR>Let's assume it is some great big number.<BR><BR>Okay, how would you represent it in a computer?<BR><BR>We already saw that:<BR> 1 / 10^1000000000 >> 10^+1000000000 (a 1 with a billion zeroes after it)<BR><BR>How about we divide by a googolplex, instead? That a googol (recall: a 1 with 100 zeroes after it) raised to the 100th power! <BR><BR>Consider: A googol squared has 200 zeroes after it. Cubed, it has 300 zeroes after it.<BR><BR>Put it another way: There are more than a googol atoms in the universe but almost surely fewer than a googolplex.<BR><BR>Okay, so now how does the computer represent a number that big?<BR><BR>If it takes more bits of information than there are atoms in the universe?<BR><BR>Mathemeticians can play with this stuff all day long, because they have the ABSTRACT math notation to let them do so. Computers want/need concrete results. [Okay, probably excepting for a few esoteric languages we've never heard of that are used only by these nutso mathematicians and which use the same abstract symbology.]<BR><BR>Nutso mathematicians. Did I mention my degree was in Math? Fortunately, so long ago that I've forgotten almost everything.<BR><BR>

RE: And just incidentally...
Yes I understand that... Some of it anyways...<BR><BR>But why cant there have been a work around or something...<BR><BR>I just wrote a work around so that if script ended up trying to devide by 0 it would not error... and crash whole script...<BR><BR>Calculators spit out err. Computers, scripts, just about anything I can thinnk of spits out error...<BR><BR>Just seems to me that in todays day in technology someone would have done something with it...<BR><BR>I know it seems a pretty simple question, but not so simple when one sits down and thinks about it...<BR><BR>Hell, up until a year or 2 ago we thought 100/3 = 33.333infinity...<BR><BR>

RE: And just incidentally...
>Hell, up until a year or 2 ago we thought 100/3 = 33.333infinity...<BR><BR>Refresh my memory....What did we figure out it actually is?

Well, 1/0 is actually undefined...
...and not infinity, otherwise you have the following problem:<BR><BR>1/x = y<BR><BR>Multiply by x on both sides:<BR><BR>1 = y*x<BR><BR>That's fine so far. Now put x = 0 and y = infinity and you get:<BR><BR>1 = infinity * 0<BR><BR>That's certainly not true. If it was, then you could also say:<BR><BR>2/0 = infinity => 2 = infinity * 0<BR>3/0 = infinity => 3 = infinity * 0<BR><BR>As you can see, that doesn't work.<BR><BR>However, you can say that 1/x goes towards infinity as x goes towards zero, but that doesn't mean that for x = 0 the result of 1/x is infinity.<BR><BR>The reason why script error when you divide by zero is because different situations have to be dealt with in different ways. In some situations you'd like 1/x to be 0 and not infinite, in others you want it to be the largest possible number and in others again you don't want it to work at all. Since a computer language can't predict what you need, it does the sensible thing and errors.<BR><BR>Now, lets see who is going to contradict me and how long we can keep the discussion going.<BR><BR>;)<BR><BR>Oliver.

I *did* say that...
...but "undefined" is even harder for most people to grasp than is "infinity".<BR><BR>When I was in 10th grade, our math teacher (had same one 10th thru 12th) used "infinity" as answer. But in 11th grade she shifted to "undefined". She'd been to a workshop over the summer and they were just then encouraging math teachers to use the formally correct term. So as I said, the answer *used* to be given as "infinity." If not among true mathematicians, at least among the lay public.<BR><BR>

HUH??????? WHAT?????
> Hell, up until a year or 2 ago we thought 100/3 = 33.333infinity...<BR><BR>Ummm...personally, I *still* think that! WHAT are you talking about?<BR><BR>And yes, there is a solution. JavaScript uses it, for example.<BR><BR>Try it!<BR><BR><SCRIPT Language=JavaScript><BR>alert( 1/0 );<BR></SCRIPT><BR><BR>Of course, it gets the WRONG answer, from the mathematical viewpoint. <grin/><BR><BR>

1/1/1900 00:00 that's when
;) Database people will understand
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

