Important: The information in this document is obsolete and should not be used for new development.
FloatToFract
You can use theFloatToFract
macro to convert a floating-point number to afract
number.
define FloatToFract(a) ((fract)((float)(a)*fract1))
a
- A floating-point number to be converted to a
fract
number.- macro result
- A
fract number having the closest value to the floating-point number.