[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Floating point and precision loss - a bug?
- From: Doug Currie <doug.currie@...>
- Date: Fri, 18 May 2007 12:37:43 -0400
On Friday, May 18, 2007 David Kastrup wrote:
> Luís Santos <lsantos@itquality.com.br> writes:
>> Hi folks,
>>
>> I have found a disturbing behaviour in the VM regarding floating point
>> calculations. [...]
> No. 1000.2 has no exact representation in base 2 floating point
> numbers.
> For that reason, financial calculations should be done in units of
> cents or decicents, not dollars (insert your appropriate local
> currency here).
If you want base 10 floating point, see
http://luaforge.net/projects/ldecnumber/
e
--
Doug Currie
Londonderry, NH, USA