1. Money (was Re: Floating Point Numbers)
On Wed, 22 Mar 2000 00:01:50 -0500, Kat <gertie at ZEBRA.NET> wrote:
>> >The only solution is to use integers only. For an assignment we had to take
>> >an order an
>> >calculate the cost. The floating point calculations were wrong. The costs
>> >were in dollars and
>> >cents. As it is a fixed position decimal I represented the prices in cents.
>> >When I dealt with it, I
>> >dealt with it in cents. I out-putted it as dollars and cents. This meant it
>> >was accurate and the
>> >user was not confused by incorrect results or prices in cents.
>> >-------------------------
>> A binary library for handling of decimal integer calculations would certainly
>> improve the accuracy of any business math in Euphoria. Of course, that
>> would require some agreement on representation of fractional numbers as
>> something other than floats.
>Well, if you are doing business math, shouldn't we recognize that not
>everyone uses dollars and cents?
True, but unless you know of some non-decimalized currencies that
are still being used, the same routines, modulo a scaling factor,
will work just fine for any currency.
--
Jeff Zeitlin
jzeitlin at cyburban.com