From: "M. Edward (Ed) Borasky" Date: 2007-09-01T00:33:53+09:00 Subject: Re: 0.06 == 0.06 returns false in Ruby? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dan Zwell wrote: > Michael wrote very convincingly that there is no simple solution that > will work in all cases. I'm convinced, at least. If there is no solution > that works 100% of the time, we can't give the illusion that there is. > To do so would be to teach bad programming practices to newcomers, and > that's not fair. > > The current "==" in okay because it works the way a moderately > experienced programmer would expect. A perfect "==" that could deal with > floats would be even better, but we aren't gonna get that. A "==" that > seems like magic and almost always works is really pretty dangerous. > > Dan > > Yeah ... even people like me who have spent several decades in this branch of computing need to be reminded of these things occasionally. What *I* wish Ruby had for scientific number-crunching is built-in floating point arrays, rather than having to pass potential large objects into and out of C language libraries to get number crunching done. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG2DTf8fKMegVjSM8RAudJAJ9wOyvmdtgSRgVVUpbXem6nLUpfKQCdEspD YgYD17sas15mJA/Q1kGMwJQ= =kZx0 -----END PGP SIGNATURE-----