Hi!

* Simon Strandgaard:
> server> irb
> irb(main):001:0> Math.sqrt(-1)
> => NaN
> irb(main):002:0>
> 
> NaN == Not a Number
> 
> Why has sqrt behavier changed, when it hasn't for divisionbyzero?

Math.sqrt(-1) is Math.sqrt(-1.to_f) is Math.sqr(-1.0)

> irb(main):002:0> 3 / 0
> ZeroDivisionError: divided by 0
>         from (irb):2:in `/'
>         from (irb):2
> irb(main):003:0>

Correct analogy were

ruby -e 'puts 3.0 / 0.0'
Infinity

No exception either.

Josef 'Jupp' SCHUGT
-- 
http://oss.erdfunkstelle.de/ruby/    -     German comp.lang.ruby-FAQ
http://rubyforge.org/users/jupp/     -     Ruby projects at Rubyforge
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Germany 2004: To boldly spy where no GESTAPO / STASI has spied before