[Webkit-unassigned] [Bug 56829] REGRESSION (r81625): fast/css/percentage-non-integer.html fails on Windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 23 09:53:17 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56829





--- Comment #15 from Rik Cabanier <cabanier at adobe.com>  2011-03-23 09:53:17 PST ---
(In reply to comment #14)
> (From update of attachment 86539 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=86539&action=review
> 
> > Source/WebCore/platform/Length.h:143
> > +                    // do not try to optimize this. It will cause incorrect rounding on 32-bit intel machines that use the FPU
> > +                    float retVal = maxValue * percent() / 100.0f;
> > +                    return static_cast<int>(retVal);
> 
> I don't think this comment is clear enough. "optimize" could have many different interpretations. Explicitly saying "Don't remove the local float variable" would be more helpful.
> 
> The first word of the comment should be capitalized, as should "Intel".
> 
> It is very surprising that a float local fixes the problem. I assume appending "f" to 100.0 wasn't enough?

Adding 'f' to the number didn't make a difference on Intel 32 bit since all calculations are done with 85bit precision.
Because the floats don't have that much precision and the cast happened on the 85bit register, we got imprecise results. Going through a float causes correct rounding.

On other platform that don't have this problem, the 'f' behind the number is good practise so the processor does all calculations in float precision.

I will fix the comment and update the patch.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list