--000e0ce0f140fe9d7a04b7baafef
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Jan 30, 2012 at 12:22 AM, Robert Klemme
<shortcutter / googlemail.com>wrote:

> It seems many people use the "floating point mess" without major
> issues.  So it cannot be as bad as you make it sound.
>

Floating points are a great choice for approximating continuous values and
thus working on things which require both high performance and
approximating real-world data sources. This includes things like games,
non-gaming related 3D applications, perceptual media including audio and
video codecs, and everything involved in working with perceptual media on
computers such as non-linear editing, speech synthesis, and speech
recognition.

People don't often do these things in Ruby. I'd say they're uncommon use
cases.

Something people do quite often in Ruby: deal with money. Money isn't
continuous, it's discrete. A decimal type is a much better choice for
dealing with money than a floating point.

As I said before, I think Ruby could benefit from decimal literals. They
can't solve all use cases. They can't be a replacement for rationals, such
as in the 1D/3D example (actually I'm not entirely convinced of that
either, but that's a sidebar)

I have found many uses for BigDecimal before and have seen Fixnums used
where BigDecimal would probably be more appropriate (i.e. "count cents, not
dollars!") where having (Big)Decimal literals would probably change
people's minds about that sort of thing.

-- 
Tony Arcieri

--000e0ce0f140fe9d7a04b7baafef--