I apparently was also able to paste too much of my session in here to be
relevant. Ignore the first three irb commands.
-Kurt
On Tue, Aug 12, 2003 at 10:53:34AM +0900, Kurt M. Dresner wrote:
> I was able to do:
>
> irb(main):012:0> a = Math::log(-1)
> => NaN
> irb(main):013:0> a.class
> => Float
> irb(main):014:0> b = "Na".to_f
> => 0.0
> 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
>
> -Kurt
>
> On Tue, Aug 12, 2003 at 10:38:40AM +0900, Scott Thompson wrote:
> > If I do something like
> >
> > a = Math::log(-1)
> >
> > then a properly takes the value NaN.
> >
> > Is there any way to explicitly assign the variable "a" to NaN (or
> > Inifinity or -Infinity) to begin with? I tried finding "NaN" as a
> > constant but couldn't locate it. It doesn't appear to be a constant in
> > Float or Math.
> >
> > Scott
> >
> >
> >======= End of Original Message =======<
>
>======= End of Original Message =======<
Posts: n/a