I have a float to represent the zoom factor on an image.
setZoomPercent( currentZoomPercent - 0.1f );
The trouble I'm having is that the decrementation is giving the following result. How can I avoid this ?
Zoom:100.0
Zoom:99.9
Zoom:99.8
Zoom:99.700005
Zoom:99.600006
Zoom:99.50001
Zoom:99.40001
Zoom:99.30001
Zoom:99.20001
Zoom:99.10001
Zoom:99.000015
Zoom:98.90002
Zoom:98.80002
P.S: I'm guessing it has to do with the binary representation of 0.1 in binary.