MulDiv

Version 3.0

Syntax

int MulDiv(nNumber,nNumerator,nDenominator)

This function multiplies two word-length values and then divides the result by a third word-length value. The return value is the final result, rounded to the nearest integer.

Parameter Type/Description  

nNumber int Specifies the number to be multiplied by nNumerator.  
nNumerator int Specifies the number to be multiplied by nNumber.  
nDenominator int Specifies the number by which the result of the multiplication is to be divided.  

Return Value

The return value is the result of the multipliation and division. The return value is 32,767 or –32,767 if either an overflow occurred or wDenominator was zero.