for example
double x = -1;
TrySetX(ref x);
if(x == -1)
//since x == -1, it obviously wasn't set
TryADifferentWayToSetX(ref x);
Use(x);
in the case where x is not changed, will x == -1 always return true, or will I have to use an epsiolon for the comparison?
The logic here is that both literals will presumable be converted to the same value, so there is no need to worry about the fact that they may lose precision.