| |||
| Home > Floating-point support > fplib conversion between long longs, floats, and doubles | |||
Table 17 describes routines to perform conversions between long longs, floats, and doubles.
Table 17. Conversion routines between long longs, floats, and doubles
| Function | Argument types | Return type |
|---|---|---|
_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 (see Notes on rounding) |
_ll_sfrom_f_r | float | long long |
_ll_ufrom_f | float | unsigned long long (see Notes on rounding) |
_ll_ufrom_f_r | float | unsigned long long |
_ll_sfrom_d | double | long long (see Notes on rounding) |
_ll_sfrom_d_r | double | long long |
_ll_ufrom_d | double | unsigned long long (see Notes on rounding) |
_ll_ufrom_d_r | double | unsigned long long |
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. This function has a corresponding
function with _r on the end of its name. This
function performs the same operation but rounds according to the current
mode.