Assuming all processors are compatible with IEEE754, and that you use the same rounding mode on all processors, you can get the same results from all different processors.
However, there may be compiled code differences or implementation differences with your code in its current form.
Consider how
fTimeStamp * 24 * 60 * 60 * 10
. Some compilers may execute
fTimeStamp * 24
and then save the intermediate result in the FP register. Then multiply this by 60 and save to the FP register. And so on.
Now, in x86, floating point registers are extended to 80 bits, and by default, these intermediate registers will hold results up to 80 bits.
ARM processors, on the other hand, do not have 80 registers. Intermediate values ββare stored with a double precision of 64 bits.
So the difference in the implementation of the machine explains your behavior.
Another possibility is that the ARM compiler puts a constant in the expression and evaluates it at compile time, reducing the above to
fTimeStamp * 864000
I have never seen an x86 or x64 compiler that does this, but perhaps an ARM compiler. This is the difference in the compiled code. I am not saying that this is happening; I do not know mobile compilers. But there is no reason why this could not happen.
However, here is your salvation. Record your expression as above with one multiplication. Thus, you get rid of any area for storing intermediate values ββwith different accuracy. Then, while Round means the same on all processors, the results will be identical.
Personally, I would avoid questions in rounding mode, and use Trunc instead of Round . I know this has a different meaning, but for your purposes it is an arbitrary choice.
After that you will be left with:
lIntStamp := Trunc(fTimeStamp * 864000); //steps of 1/10th second lIntStamp := lIntStamp and $FFFFFFFF;
If Round behaves differently on different platforms, you may need to implement it yourself on ARM. In x86, the default rounding mode is bankers. It matters only halfway between two integers. Therefore, check if Frac(...) = 0.5 and round accordingly. This check is safe because 0.5 is accurately representable.
On the other hand, you seem to argue that
Round(36317325722.5000008) = 36317325722
on ARM. If so, this is a mistake. I canβt believe what you say. I believe that the value passed to Round is actually 36317325722.5 on ARM. This is the only thing that can make sense to me. I can't believe Round faulty.