Antonio,

First, check the value of tcl_precision to verify it is zero. See www.tcl.tk/man/tcl8.6/TclCmd/tclvars.htm about half way down page.

Second, this looks like a standard binary math issue that affects most any computer language. See: http://en.wikipedia.org/wiki/Floating_point#Minimizing_the_effect_of_accuracy_problems

When making an application that calculates currency, caution should be used to round off to the lowest denomination at appropriate places to avoid this kind of error. Commonly, a smallest value of 0.01 is assumed (cents in USD for example), but some currencies have a smallest unit of 0.05 for example.

Avoid coding that exacerbates binary errors in calculation, such as using ceiling before completing a rounding error. This is also true if using a currency value for a logical comparison with the value of 0, such as:

if { expr { 2241.57 *100 - 224157 } == 0 } { ... }

as there will be faulty logic. Round to the currency's lowest transferable unit first. Or, in the case of a logical comparison of zero, one can see if the error in comparison is less than the smallest transferable unit of currency; for example, see ec_same_value in ecommerce/tcl at end of http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl?hb=true

cheers,

Benjamin