You copied the Doc URL to your clipboard.

-ffast-math, -fno-fast-math

-ffast-math tells the compiler to perform more aggressive floating-point optimizations.

-ffast-math results in behavior that is not fully compliant with the ISO C or C++ standard. However, numerically robust floating-point programs are expected to behave correctly.

Using -fno-fast-math disables aggressive floating-point optimizations. It also ensures that the floating-point code that the compiler generates is compliant with the IEEE Standard for Floating-Point Arithmetic (IEEE 754).


ARM® Compiler 6 uses neither -ffast-math nor -fno-fast-math by default. For the default behavior, ensure you specify neither -ffast-math nor -fno-fast-math.

These options control which floating-point library the compiler uses. For more information, see the library variants in ARM C and C++ Libraries and Floating-Point Support User Guide.

Table 1-1 Floating-point library variants

armclang option Floating-point library variant Description
Default fz IEEE-compliant library with fixed rounding mode and support for certain IEEE exceptions, and flushing to zero.
-ffast-math fz Similar to the default behavior, but also performs aggressive floating-point optimizations and therefore it is not IEEE-compliant.
-fno-fast-math g IEEE-compliant library with configurable rounding mode and support for all IEEE exceptions, and flushing to zero.
Was this page helpful? Yes No