I'm trying to retrieve any digits that come after a decimal point in any given number (below an example number is represented by "in").
double in = 1.2;
double out = in - (int)in;
Here I expect/want "out" to equate to 0.2 but the number comes out as 0.19999999999999996. Why is this and how can I get the result I want?