From: "Kurt M. Dresner" Date: 2003-08-12T11:20:53+09:00 Subject: Re: NaN and Inifinity Oh yeah, I'm way out of date. I think I'm using 1.6.something. -Kurt On Tue, Aug 12, 2003 at 11:16:41AM +0900, Dan Doel wrote: > Scott Thompson wrote: > > >>irb(main):015:0> a = Math::log(-1) > >>=> NaN > >>irb(main):016:0> a.class > >>=> Float > >>irb(main):017:0> b = "NaN".to_f > >>=> NaN > >>irb(main):018:0> b.class > >>=> Float > >>irb(main):019:0> b.nan? > >>=> true > > > > > >Hrrrm... Okee dokey. I tried something like that and I get > > > >irb(main):002:0> b = "NaN".to_f > >=> 0.0 > >irb(main):003:0> b.nan? > >=> false > > > >There must be something wacky with my Ruby. :-) > > > >Scott > > It's not just you. Happens to me, too, using Ruby 1.8.0pre9 (I believe) > mswin32 build. > > Then again, Math::log(-1) throws a domain error for me. > > If worse comes to worst you could always initialize with Math::log(-1), > since that returns > what you want. > > - Dan > > >======= End of Original Message =======<