Document wxMulDivInt32() and add a test for it

This function exists since always and is probably already used outside
wx, so make it officially public and add at least a trivial unit test
for it.
This commit is contained in:
Vadim Zeitlin
2021-07-11 18:44:29 +01:00
parent b39cf5da32
commit 7c6f290995
2 changed files with 24 additions and 0 deletions

View File

@@ -115,5 +115,15 @@ bool wxIsSameDouble(double x, double y);
*/
bool wxIsNullDouble(double x);
/**
Computes the product of a number with a fraction with rounding.
This function returns @c n*numerator/denominator rounding the result. It is
similar to the standard Win32 @c MulDiv() function and, in fact, is
implemented by calling it under MSW, where @c wx/msw/wrapwin.h must be
included in addition to @c wx/math.h for it to be used.
*/
int wxMulDivInt32(int n, int numerator, int denominator);
//@}