On Friday, January 23, 2015 at 1:27:18 PM UTC-5, Luc wrote: > > Danger vs flexibility. > > < or > are safe. Should they throw an exception then ? > > Compiler in some older typed languages would warn you about testing > equality between two float numbers irrelevant of their types but would be > silent about other operators. > > Testing equality with floats is seldom used in the context of heavy > computations. Testing against a range is often preferred. >
Often, but there can be exceptions. When floats appear as part of objects put in a set or used as map keys is one of them. Not long ago I had something doing numeric work where calculations produced double values and certain runs of inputs would produce identical output, down to the last decimal place. Detecting such runs was as simple as using a map with double keys and checking whether it already had an entry for a value, then dispatching some other code based on the value found, as inputs that produced one value needed one sort of additional processing, and another value another sort. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.