Hi,

normally, the only pratical reason for such requirements (to get the
same results
on all platforms) is that you are doing financial math with floating
point. Otherwise,
if you do scientific math, it is more important that the results are as
exact as possible,
but not the same on all platforms.

So, assumed that you are doing financial math, the error in the
computations using
floating point are in the 10e-15 range (in relation to the result), so
for computing dollars
and cents, this doesn't really matter. I always assume that you are
using double (8 bytes),
not float (4 bytes).

The real problem is rounding.

Maybe your computation yields a result of 12.345 dollar, which should be
rounded
to 12.35.

But due to floating point number representation and small errors in the
float
arithmetic, your result is (in decimal) 12.3449999996. So it get's
rounded to
12.34, and you're in a real mess.

This problem needs to be fixed. So after some computations (and: before
doing
output or converting into decimal representation or such things), you
have to add to
the FP numbers some little epsilon, which corrects the error and allows
the subsequent
rounding to take the correct value.

Our experience is: if you choose the epsilon carefully, you will get the
same results
even on different platforms in MOST cases. But there is still no
guarantee that it will
work in ALL cases. Some ten years ago I explained our rounding function
to a
math scientist, and he said: "it's not bad, what you're doing, but you
can do anything
you want: I'll always find an example where it will not work".

Kind regards

Bernd




Am 23.03.2011 13:08, schrieb Miklos Szigetvari:
    Hi

Thank you.
Our problem is: which option and where to change to get the same result.

 Till now we have ignored this differences( in AFP documents, position
difference sometimes in 1 pel),
but some of our customers are saying, they would like to get the same
result , in all platforms .


Reply via email to