| flt | Function (ROM Call 0xBD*)

timath.h

float flt (long x);

Converts integer to floating point.

flt converts the (long) integer argument x to the floating point representation of the same value. This routine performs the same operation as casting a long integer value to float type using the `'(float)'` typecast operator, but it is kept here to allow compatibility with older programs created before TIGCC introduced floating point operators (i.e. before release 0.9 of TIGCC). This function is automatically called when any floating point function is called with a long integer argument, to force a promotion of an integer to a floating point type. In other words, integer values will be automatically promoted to the floating point type when necessary. So, you can do assignment like b = a; when a is an integer variable (or expression) and b is a standard floating point variable (float or double). Also, you can calculate sin(a) where a is an integer. In both cases, flt will be called automatically to perform the promotion. At the fundamental level, flt is exactly the same routine as bcdbcd.

Uses: _bcd_math