Use rational numbers... if you are using C++ the boost library rational classes may be a good point to start.
If you are basing your calculations on discrete prices (i.e. 0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, ...) then maybe you should consider storing the price in ticks i.e (0 -> 0.0, 1 -> 0.5, 2...