C float literal translation

Just for reference's sake, the relevant chapter in GCC's manual states:

How the nearest representable value or the larger or smaller representable value immediately adjacent to the nearest representable value is chosen for certain floating constants (C90 6.1.3.1, C99 and C11 6.4.4.2).

C99 Annex F is followed.

And in my draft C99 standard, Annex F says:

F.7.2 Translation

During translation the IEC 60559 default modes are in effect:

— The rounding direction mode is rounding to nearest.
— The rounding precision mode (if supported) is set so that results are not shortened.
— Trapping or stopping (if supported) is disabled on all floating-point exceptions

So that seem to clearly state that

  • GCC uses rounding to nearest.
  • You can't change it.

Using the hexadecimal syntax to get the exact desired float seems like the proper solution here, and (I guess) the reason that syntax exists.