I have a variable of type float with some value, and there is a point where that value is cast to a double type variable, at that moment the value in the float variable is no more what I see in the double type variable. To make this example easy to follow, I do this in the immediate window to produce whats happening:
(double)float.Parse ( "-0.00146256")
gives me -0.001462560030631721
the "-0.00146256" (in a string yes) is the origin of this value, and its stored in a float with float.Parse() some where in code, and then at a later point cast to double.
Why is the value changing to a different one in the double variable, and what can I do to prevent this non precision behavior?