‑‑relaxed_fp
Syntax
Description
Use this option to allow the compiler to relax the language rules and perform more aggressive optimization of floating-point expressions. This option improves performance for floating-point expressions that fulfill these conditions:
The expression consists of both single and double-precision values
The double-precision values can be converted to single precision without loss of accuracy
The result of the expression is converted to single precision.
Note
Performing the calculation in single precision instead of double precision might cause a loss of accuracy.
Example
float F(float a, float b)
{
return a + b * 3.0;
}The C standard states that 3.0 in this example has the type double and therefore the whole expression should be evaluated in double precision. However, when the ‑‑relaxed_fp option is used, 3.0 will be converted to float and the whole expression can be evaluated in float precision.
Caution
To set related options, choose:
Project>Options>C/C++ Compiler>Language 2 >Floating-point semantics