Carbon


FixRound

Header: FixMath.h Carbon status: Supported

Rounds a fixed-point number to the nearest integer.

SInt16 FixRound (
    Fixed x
);
Parameter descriptions
x

The Fixed number to be rounded.

function result

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.

DISCUSSION

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.

AVAILABILITY

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)