mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
== instead of =
really should be +/- epsilon, or change double to int
This commit is contained in:
parent
bcb93bd803
commit
5e855a2de4
|
@ -10167,7 +10167,7 @@ Note that this applies most urgently to library code and least urgently to stand
|
|||
static double cached_result = COMPUTATION_OF_ZERO;
|
||||
double result;
|
||||
|
||||
if (cached_x = x)
|
||||
if (cached_x == x)
|
||||
return cached_result;
|
||||
result = computation(x);
|
||||
cached_x = x;
|
||||
|
|
Loading…
Reference in New Issue
Block a user