Many floating point values are approximations and can't be stored exactly. float has lower precision than double so if you change double someVal = 6.6f;
to double someVal = 6.6;
you will probably get the correct output. Note that someVal is probably still an approximation of 6.6.