In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: |> |> > Financial calculations need decimal FIXED-point, with a precisely |> > specified precision. It is claimed that decimal FLOATING-point |> > helps with providing that, but that claim is extremely dubious. |> > I can explain the problem in as much detail as you want, but would |> > very much rather not. |> |> Ok I will throw in a skewed ball at this point - use integer arithmetic, |> and work in tenths of cents or pennies or whatever, and don't be too |> lazy to do your own print formatting...
That's not a skewed ball - that's the traditional way of doing it on systems that don't have fixed-point hardware (and sometimes even when they do). Yes, it's dead easy in a language (like Python) that allows decent encapsulation. The decimal floating-point brigade grossly exaggerate the difficulty of doing that, in order to persuade people that their solution is better. If they admitted the difficulties of using decimal floating-point, and merely said "but, overall, we think it is a better solution", I would disagree but say nothing. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list