From: "Shot (Piotr Szotkowski)" Date: 2009-04-17T01:29:58+09:00 Subject: [ruby-core:23221] Re: [Bug #1336] Change in string representation of Floats --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gary Wright: > IEEE also defines negative 0.0, which > has interesting behavior in Ruby (1.8): > >> z =3D 0.0 > >> nz =3D -0.0 > >> p z > 0.0 > =3D> nil > >> p nz > -0.0 > =3D> nil > >> z =3D=3D nz > =3D> true > >> z.eql? nz > =3D> true > I would have thought that z.eql?(nz) might be false. There doesn't=20 > seem to be a way to query a float to distinguish between -Infinity > and Infinity These actually aren=E2=80=99t =3D=3D, eql? nor equal? > or between -0.0 and 0.0 other than via #to_s. -0.0.equal? 0.0 # =3D> false =E2=80=94 Shot --=20 Nobody came to my trombone recital. I wish there was some way to express how I feel right now. [Joshua Green Allen] --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknnXQAACgkQi/mCfdEo8UqGwQCfYlYnp7zQ8WRokT/iQPpMRW5f IRsAoI4RY3TMVrityd84ixIERaAb5HvY =7KaH -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK--