FixRound
FixRound Get nearest short integer to a fixed-point value Fixed fixedNum ; fixed-point number to round returns 16-bit integer rounded up from fixedNum
FixRound rounds a positive fixed-point number, returning the value of the nearest short integer.
fixedNum is a 4-byte fixed-point value.The function rounds correctly for
positive values only. See Notes, below
Returns: a 16-bit signed integer; the nearest integer to fixedNum. If the fractional part of fixedNum is .5, the return value is rounded up to
the next higher integer.
Notes: To round a negative fixed-point number correctly (i.e., a larger fraction
being more negative), you should first negate fixedNum, call FixRound, then negate the returned integer; e.g.:
short rounded;
if (unRounded < 0 )
else