Important: The information in this document is obsolete and should not be used for new development.
FloatToFixed
You can use theFloatToFixed
macro to convert a floating-point number to aFixed
number.
#define FloatToFixed(a) ((Fixed)((float) (a) * fixed1))
a
- A floating-point number to be converted to a
Fixed
number.- macro result
- The closest
Fixed number to the floating-point number.
SPECIAL CONSIDERATIONS
QuickDraw GX also defines a shorthand version of this macro. TheFloatToFixed
macro can also be coded asfl(a)
.SEE ALSO
Thefl
macro is described next.