On Sat, Feb 26, 2011 at 4:48 PM, Juan Lang juan.lang@gmail.com wrote:
Hi Misha,
My own (very unhelpful) diagnosis of the pattern is that, for the mantissa values:
2018.5 should round to 2018 2019.5 should round to 2020
The pattern appears to be "round half to even", which you may read about on Wikipedia: http://en.wikipedia.org/wiki/Rounding#Round_half_to_even --Juan
Thanks Juan. I have implemented this in the patch.
I am, unfortunately, still pretty stumped. There are quite a few cases per Matteo's wonderful rounding code for truncation of very small (?) numbers where rounding should _not_ occur.
I have included relevant output from running make math.ok for those cases.
Note, that it is not the specific mantissa #'s per se (I checked), not even combinations of mantissa #'s and exp's, and not mantissa #'s and exp's and <= 0.25f difference between ((unsigned int) tmp) and (((unsigned int) tmp) & 0x3ff) - I checked all these.
There is apparently some pattern in the original single #'s themselves that I am not seeing.
If anyone has a keener eye than I let me know.
Also, I am assuming a stub of this function would actually not be accepted into Wine (can't return E_NOTIMPL, e.g.).
If I am _incorrect_ about this please let me know.
Thank you. Have a great Saturday!
Misha