gdiplus/graphicspath: Avoid computation overflow and underflow by using hypotf.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45123
By using sqrt(a * a + b * b), for large (or small) a or b, there is a possibility of overflow (underflow),
although the result itself is not that big to cause overflow.
To overcome this problem, there are implementations of hypotenuse that do not use power of 2,
and use other methods to calculate the result.
To calculate a ⊕ b, you can easily use hypotf(a,b).
https://en.cppreference.com/w/cpp/numeric/math/hypot
Showing
Please
register
or
sign in
to comment