From: "M. Edward (Ed) Borasky" Date: 2007-09-01T00:30:08+09:00 Subject: Re: 0.06 == 0.06 returns false in Ruby? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Robert Klemme wrote: > 2007/8/31, Pe�a, Botp : >> From: Robert Klemme [mailto:shortcutter@googlemail.com] >> # And who decides about the size of epsilon and which algorithm to >> # choose? There is no one size fits all answer to that hence leaving >> # Float#== the way it is (i.e. compare for exact identical values) is >> # the only viable option. Otherwise you would soon see similar >> # questions on the list, i.e., "how come it sometimes works and >> # sometimes it doesn't". And they become more difficult to answer as >> # the cases are likely less easy to spot / explain. >> >> indeed :( >> >> maybe i'm not "realistic" but i thought >> >> 0.05 + 0.01 == 0.06 => false >> >> was "unrealistic" enough for a simple and plain 2 decimal arithmetic. Even people w zero-know on computers would laugh about it (yes, try explaining it to your wife or kids, eg). > > That's probably the exact reason why not your wife or kids write > software but people who are (hopefully) experts. :-) If you study > computer sciences you'll typically hit the topic of numeric issues at > some point. Actually, unless you're a (hard) science or engineering major, you probably won't. Numerical analysis/methods aren't really considered part of "computer science". Computer science is mostly about *discrete* mathematics, data structures, programming languages and their interpreters and compilers, etc. And you probably won't get it in a "software engineering" program either. Applied mathematics is your best shot, I think. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG2DP18fKMegVjSM8RAhnIAKDO4mMSDAh/pJ1BSe4ICFj4tD+9vACfdgh5 CZvGLjrSlH4QVf6sEG2b4Lc= =XRUf -----END PGP SIGNATURE-----