@dseligo

This works with a minimal interference in the existig code. Thank you!

@PascalDragon

I understand, that - in general - decimal numbers can not be represented exactly in the binary system. But why is the calculation in question different in Win32 and Win64?

Is it so, that for some numbers the calculation gives the expected result and for others not - dependent from the conversation from binary to decimal? If this is the case then for some numbers the outcome of trunc(log2(number)) might be as expected in Win32 - for others in Win64.

Please confer what Bart wrote earlier in this post. From his post I got the impression, that the calculation allways leads to expected results in Win32.

I hope that the thread does not get to sophisticated here, but I am interested in understanding what's really going on.