Make C floating point literals float (rather than double)

后端 未结 4 1085
走了就别回头了
走了就别回头了 2020-12-04 17:40

It is well known that in C, floating point literals (e.g. 1.23) have type double. As a consequence, any calculation that involves them is promoted

4条回答
  •  无人及你
    2020-12-04 17:58

    -fsingle-precision-constant flag can be used. It causes floating-point constants to be loaded in single precision even when this is not exact.

    Note- This will also use single precision constants in operations on double precision variables.

提交回复
热议问题