For example, I have something like this code:
double a = 68.24;
double b = 0.01;
double c = a - b;
c is equal to 68.22999999999999. And let's say that I cannot change types of a, b and c (it should be double). But I can do this:
double a = 68.24;
double b = 0.01;
decimal _c = (decimal) a - (decimal) b;
double c = (double)_c;
Now c is 68.23, which is what I need.
But could I lose precision of c converting from decimal _c if I have different values of a and b?
More broadly, when double lose its precision? Because, a and b in debugger are precise (or at least it is what it shows), if I convert them to decimal they are precise too. But operation on them somehow creates imprecise value.