Made math work properly in python 2 and 3

Old code was doing an integer division, essentially useless
Merge pull request #12 from msoucy/math

Made math work properly in python 2 and 3