Raphael Clancy <raphael.clancy / gmail.com> wrote:
> 
> [...] I can come up with several reasons why we should 
> keep the IEEE spec. First, it's [ ... ]

One important reason was not mentioned here: In floating point processing we
have limited precision which leads to different semantics. Doing integer
arithmetics 5 is 5, 1 is 1 and 0 is 0. In floating point arithmetics 5.0,
1.0 and 0.0 represent an interval. See the following in irb (on a 32 bit
Linux box):

irb(main):007:0> 10**-200/10.0**200
=> 0.0
irb(main):008:0> -10**-200/10.0**200
=> -0.0
irb(main):009:0> 42.23 / (10**-200/10.0**200) 
=> Infinity
irb(main):010:0> 42.23 / (-10**-200/10.0**200) 
=> -Infinity
irb(main):011:0> (10**200/10.0**-200)
=> Infinity
...

That's simply the closest we can get with limited precision.

Floating point arithmetics _differs_ from doing math on R, and it's
important to know this:

irb(main):031:0> 0.1**2 == 0.01
=> false
irb(main):032:0> 0.1**2 - 0.01
=> 1.73472347597681e-18
irb(main):033:0> (0.1**2 - 0.01) < 1e-9
=> true

> So I guess I'm all for keeping the spec, IEEE is practical, but it 
> doesn't seem very "Ruby". ;-D

You could also claim floating point arithmetics is not very "Ruby2...

Klaus
-- 
http://lapiz.istik.de/

The Answer is 42. And I am the Answer. Now I am looking for the Question.