On Tue, 12 Oct 2010 17:44:20 -0400
Brian Hurt <bhur...@gmail.com> wrote:

> On Tue, Oct 12, 2010 at 3:35 PM, cej38 <junkerme...@gmail.com> wrote:
> 
> > The more that I think about it, the more I would rather have a set of
> > equalities that always work.  float= was a good try.
> <RANT>

Maybe initially, but not later on...

> Floating point is not broken.
> </RANT>

Well, no more broken than any other representation of numbers on the
computer. All of them have problems of one sort or another.  For
almost any problem you're going to solve with a computer, picking the
right representation for your data is a crucial step!

While you may understand the mathematics of numbers quite well, no
computerized representation will give you that behavior (even integers
are usually weird, either having a number which has no additive
inverse, or having two zeros). You can expect every mathematical
entity to have this problem: pretty much every computer representation
will not have some property or properties of the original, so you have
to figure out which properties you really care about, and pick the
representation that has those properties.

That picking the right representation of numbers is a crucial step may
be surprising, but it's still true. Most languages have settled on the
same set of choices (in order of decreasing use): integers, either
with or without size limits; floats; decimals, either with or without
explicit lengths; and rationals. You can expect that most problems can
be dealt with adequately by one of these. If not - well, there are
lots of other choices out there that you can play with as well.

     <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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

Reply via email to