python - How to get precise division? -
python - How to get precise division? -
this question has reply here:
how can forcefulness partition floating point in python? 11 answersi'm trying precise partition python without success.
104101/2 gives 52050 whereas need 52050.5
i tried "%0.2f" % (104101/2) giving me '52050.00'.
javascript equivalent works. thought what's wrong me?
104101/2.0
104101/float(2)
or utilize python 3
python int division python-2.x floating-point-precision
Comments
Post a Comment