[PATCH 2/4] gdiplus: Partially implement arrow caps

Nikolay Sivov bunglehead at gmail.com
Mon May 14 11:27:20 CDT 2018


On 5/14/2018 7:02 PM, Vincent Povirk wrote:
>> +static BOOL compare_float(float f, float g, unsigned int ulps)
>> +{
>> +    int x = *(int *)&f;
>> +    int y = *(int *)&g;
>> +
>> +    if (x < 0)
>> +        x = INT_MIN - x;
>> +    if (y < 0)
>> +        y = INT_MIN - y;
>> +
>> +    if (abs(x - y) > ulps)
>> +        return FALSE;
>> +
>> +    return TRUE;
>> +}
> 
> I'm confused by this function. Why are you testing the difference of 2
> floats interpreted as integers?
> 
> 

That's a way to compare them, without introducing arbitrary difference
constant, that is meaningless out of context of numbers being compared.

The goal of the test is to test that numbers are close enough, in terms
of a number of representable floating point values between comparands.

The function was taken as is from existing d3d tests.



More information about the wine-devel mailing list