Is it safe to use the '==' operator to determine if a double variable in C++ has changed since its initialization to 0.0?
For performance reasons I want to avoid re-calcuation of a value inside a nested for-loop if it has been already calculated.
If it is considered unsafe: Can this lead to false positives (i.e. the expression returns true although the value does not equal 0.0), false negatives (i.e. the expression returns false although the values is indeed 0.0) or both/undetermined behaviour?
I am using C++-14 and the GNU C++ compiler v5.4.