![]() |
FixRound |
||||
Header: | FixMath.h | Carbon status: | Supported | |
Rounds a fixed-point number to the nearest integer.
SInt16 FixRound ( Fixed x );
The Fixed number to be rounded.
The Integer number nearest the Fixed number x. If the value is halfway between two integers (0.5), it is rounded up. Thus, 4.5 is rounded to 5, and 3.5 is rounded to 3.
To round a negative Fixed number so that values halfway between two integers are rounded to the number with the higher absolute value, negate the number, round it, and then negate it again.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)