From: Josh Cheek Date: 2010-11-25T04:35:12+09:00 Subject: Re: Ruby 1.8 vs 1.9 --00163630e8695f99050495d19693 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 24, 2010 at 1:16 PM, Phillip Gawlowski < cmdjackryan@googlemail.com> wrote: > On Wed, Nov 24, 2010 at 8:02 PM, Josh Cheek wrote: > > > > Its wrongness is an interpretation (I would also prefer that it just > break, > > but I can certainly see why some would say it should be infinity). And = it > > doesn't apply only to Ruby: > > It cannot be infinity. It does, quite literally not compute. There's > no room for interpretation, it's a fact of (mathematical) life that > something divided by nothing has an undefined result. It doesn't > matter if it's 0, 0.0, or -0.0. Undefined is undefined. > > From my Calculus book (goo.gl/D7PoI) "by observing from the table of values and the graph of y =3D 1/x*=C2=B2* i= n Figure 1, that the values of 1/x*=C2=B2* can be made arbitrarily large by taking x= close enough to 0. Thus the values of f(x) do not approach a number, so lim_(x->0= ) 1/x*=C2=B2* does not exist. To indicate this kind of behaviour we use the notation lim_(x->0) 1/x*=C2=B2* =3D =E2=88=9E" Since floats define infinity, regardless of its not being a number, it is not "absurd to the extreme" to result in that value when doing floating point math. > That other languages have the same issue makes matters worse, not > better (but at least it is consistent, so there's that). > > The question was "Is there anything in the above which applies only to Ruby and not to floating point computation in another other mainstream programming language?" the answer isn't "other languages have the same issue", it's "no". --00163630e8695f99050495d19693--