X-Mail-Count: 100000 [RE: Major Addition Bug?]

Ruby-talk has now reached 100,000 messages :slight_smile:

-austin

···


austin ziegler * austin.ziegler@evault.com

-----Original Message-----
From: Michael Geary [mailto:Mike@DeleteThis.Geary.com]
Sent: 12 May 2004 14.49
To: ruby-talk ML
Subject: Re: Major Addition Bug?

Phil Tomson wrote:

[Floating point imprecision seems] to present a major
problem if you
want to deal with financial figures, for example. Are there any
workarounds?

Financial calculations aren’t done in floating point. There
are various number formats that are used, but they all boil
down to some form of integer arithmetic. For example, fixed
point decimal may be used, where the value
$625.91 is represented as the integer 62591 with a scaling
factor of two decimal places. In other words, the arithmetic
is actually done in pennies, not dollars.

-Mike