From: Dan North Date: 2003-08-19T23:33:49+09:00 Subject: Re: NaN and Inifinity Hi Scott. It might help to think of NaN meaning "some undefined value". Then it makes sense that you can't assign it - it's undefined - and also that you can't compare two NaNs - they're both undefined so how can you? All you can do is use Float.nan? to ask whether the result of what you just did, in this case log(-1), is undefined. It also helps explain why it isn't, um, defined in Math or Float. Cheers, Dan 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 > > >