.\" Generated by the Allegro makedoc utility .TH ftofix 3alleg4 "version 4.4.3" "Allegro" "Allegro manual" .SH NAME ftofix \- Converts a floating point value to fixed point. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B fixed ftofix(double x); .SH DESCRIPTION Converts a floating point value to fixed point. Unlike itofix(), this function clamps values which could overflow the type conversion, setting `errno' to ERANGE in the process if this happens. Example: .nf fixed number; number = itofix(-40000); ASSERT(fixfloor(number) == -32768); number = itofix(64000); ASSERT(fixfloor(number) == 32767); ASSERT(!errno); /* This will fail. */ .fi .SH "RETURN VALUE" Returns the value of the floating point value converted to fixed point clamping overflows (and setting `errno'). .SH SEE ALSO .BR fixtof (3alleg4), .BR itofix (3alleg4), .BR fixtoi (3alleg4), .BR exfixed (3alleg4), .BR exrotscl (3alleg4), .BR exspline (3alleg4), .BR exupdate (3alleg4)