SDCC supports IEEE (single precision 4bytes) floating point numbers.The floating point support routines are derived from gcc's floatlib.c and consists of the following routines.

- _fsadd.c - add floating point numbers.
- _fssub.c - subtract floating point numbers
- _fsdiv.c - divide floating point numbers
- _fsmul.c - multiply floating point numbers
- _fs2uchar.c - convert floating point to unsigned char
- _fs2char.c - convert floating point to signed char.
- _fs2uint.c - convert floating point to unsigned int.
- _fs2int.c - convert floating point to signed int.
- _fs2ulong.c - convert floating point to unsigned long.
- _fs2long.c - convert floating point to signed long.
- _uchar2fs.c - convert unsigned char to floating point
- _char2fs.c - convert char to floating point number
- _uint2fs.c - convert unsigned int to floating point
- _int2fs.c - convert int to floating point numbers
- _ulong2fs.c - convert unsigned long to floating point number
- _long2fs.c - convert long to floating point number.

Note if all these routines are used simultaneously the data space might overflow. For serious floating point usage it is strongly recommended that the Large model be used (in which case the floating point routines mentioned above will need to recompiled with the --model-Large option)

Next Previous Contents