Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 3 - Mathematical and Logical Utilities / Mathematical and Logical Utilities Reference
Routines / Converting Between Fixed-Point and Integral Values


You can use the FixRound function to round a fixed-point number to the nearest integer.

FUNCTION FixRound (x: Fixed): Integer;
The Fixed number to be rounded.
The FixRound function returns the Integer number nearest the Fixed number you supply in the x parameter. 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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice