From: Yukihiro Matsumoto Date: 2004-10-13T21:38:22+09:00 Subject: Re: "nan".to_f ? Hi, In message "Re: "nan".to_f ?" on Wed, 13 Oct 2004 21:18:38 +0900, Markus writes: |> It's not valid string representation of a float. | | Then why does: | |x = 0.0/0.0 |x.class #Float |x.to_s #NaN | | If "NaN" is not the valid string representation of a Float, why |does calling Float#to_s return it? Although we can tell whether a float value is NaN by using isnan(), but as far as I know there's no portably way to generate NaN. I think it's not guaranteed that 0.0/0.0 generate NaN. If I'm wrong, feel free to correct me. matz.