I am stuck with floats (doubles, to be precise) comparison.
Machine 'real-numbers' such as floats and doubles should be thought of as intervals or neighborhoods near the mathematical number. Tests for 'equality' of machine reals should never use machine equality '==' operators. 'Equality' of two machine reals , in this case, means that the two numbers are separated by a distance less than some small number, such as '(fabs(a-b) < epsilon)'. Exactly what the value of epsilon should be gets a little tricky.
Hope that I am not being too pedantic but imo you should never test for 'equality' ('==') when using machine real data types.
Rick B. *------------------------------------------------- * Stop spam before it gets to your mailbox! Support blocklists. * I use http://www.spamcop.net/. * my PGP key id: 0x63fa758 keyserver: http://keyserver1.pgp.com */ _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com