fixed floating point error in python 2.7