3.2.3 fplib conversions between floats, long longs, doubles, and ints

fplib provides a number of routines to perform conversions between number formats.

The following table describes these routines.

Table 3-2 Number format conversion routines

Function Argument types Return type
__aeabi_f2d float double
__aeabi_d2f double float
_fflt int float
_ffltu unsigned int float
_dflt int double
_dfltu unsigned int double
_ffix float int
_ffix_r float int
_ffixu float unsigned int a
_ffixu_r float unsigned int
_dfix double int a
_dfix_r double int
_dfixu double unsigned int a
_dfixu_r double unsigned int
_ll_sto_f long long float
_ll_uto_f unsigned long long float
_ll_sto_d long long double
_ll_uto_d unsigned long long double
_ll_sfrom_f float long long a
_ll_sfrom_f_r float long long
_ll_ufrom_f float unsigned long long a
_ll_ufrom_f_r float unsigned long long
_ll_sfrom_d double long long a
_ll_sfrom_d_r double long long
_ll_ufrom_d double unsigned long long a
_ll_ufrom_d_r double unsigned long long
a 

Rounded toward zero, independently of the current rounding mode. This is because the C standard requires implicit conversions to integers to round this way, so it is convenient not to have to change the rounding mode to do so. Each function has a corresponding function with _r on the end of its name, that performs the same operation but rounds according to the current mode.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.