18

When do you use fp:strict as opposed to fp:precise? Is it better to use the former if I want "more precise" calculations and avoid rounding errors? What is the heuristic behind using either?

unj2
  • 52,135
  • 87
  • 247
  • 375

1 Answers1

25

The standard IEEE 754 specifies a method for floating point calculations and storage of floating point values in memory.

Using fp:strict means that all the rules of IEEE 754 are respected. fp:strict is used to sustain bitwise compatibility between different compilers and platforms.

fp:precise weakens some of the rules, however it warranties that the precision of the calculations will not be lost.

fp:fast allows compiler specific optimizations and transformations of expressions containing floating point calculation. It is the fastest methods but the results will differ between different compilers and platforms.

Sergey K.
  • 24,894
  • 13
  • 106
  • 174