The closest representation of 1.7 is different for float and double, so casting to a float should usually result in the same number.
One of the main reasons you can't compare floating point numbers is that identities that work for real numbers and integers don't necessarily work for floating point because of rounding - i.e. (x+y)+z and x+(y+z) can often be different (note that writing them that way will often not change a compiler's behavior, but you can induce the order by doing something the compiler wont optimize around).
For instance, (100 - (100 - .0000000001)) != .00000000001 using IEEE-754 doubles, even though math says they should be equal. So the computation that should be producing .00000000001 will be slightly off. This is especially a problem with more complicated calculations, such as linear algebra, where the answer can be the result of thousands of additions and subtractions, each of which can add to floating point rounding error.
IEEE-754 floating point can be very tricky, if you don't really understand what's going on.
I recommend the excellent "What every Computer Scientist Should Know About Floating-Point Arithmetic": http://docs.sun.com/source/806-3568/ncg_goldberg.html