G
GOTO Kentaro
Hi,
In message "Re: "nan".to_f ?"
Agreed! And if there exists NaN on a non IEEE platform,
that NaN must be another concept because NaN is defined in
IEEE 754.
Gotoken
In message "Re: "nan".to_f ?"
| def aNaN
| s, e, m = rand(2), 2047, rand(2**52-1)+1
| [sprintf("%1b%011b%052b", s,e,m)].pack("B*").unpack("G").first
| end
|
|I believe this will generate NaN on environments where
|pack/unpack works and NaN exists.
If the platform uses IEEE floating number, right?
Agreed! And if there exists NaN on a non IEEE platform,
that NaN must be another concept because NaN is defined in
IEEE 754.
Gotoken