The
MulDiv function multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The return value is rounded up or down to the nearest integer.
Syntax
int MulDiv(
__in int nNumber,
__in int nNumerator,
__in int nDenominator
);
Parameters
- nNumber [in]
-
Multiplicand.
- nNumerator [in]
-
Multiplier.
- nDenominator [in]
-
Number by which the result of the multiplication is to be divided.
Return Value
If the function succeeds, the return value is the result of the multiplication and division. If either an overflow occurred or nDenominator was 0, the return value is –1.
Requirements
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | Winbase.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
See Also
- Large Integers
- Int32x32To64
- UInt32x32To64
Build date: 7/30/2009