5.2.2. Conversions between floats, doubles, and ints

The routines in Table 5.2 perform conversions between number formats, excluding long longs.

Table 5.2. Number format conversion routines

FunctionArgument typeResult type
_f2dfloatdouble
_d2fdoublefloat
_ffltintfloat
_ffltuunsigned intfloat
_dfltintdouble
_dfltuunsigned intdouble
_ffixfloatint[1]
_ffix_rfloatint
_ffixufloatunsigned inta
_ffixu_rfloatunsigned int
_dfixdoubleinta
_dfix_rdoubleint
_dfixudoubleunsigned inta
_dfixu_rdoubleunsigned int

[1] 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.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential