lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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