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 answers

i'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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -