When I try to divide 696 252 / 17 500 423 I always get 0.0. Is there a way to increase the precision of such divisions?
            Asked
            
        
        
            Active
            
        
            Viewed 219 times
        
    2 Answers
2
            Convert either of the numbers to float with float function, like this
print float(696252) / 17500423  # 0.0397848669144
        thefourtheye
        
- 233,700
 - 52
 - 457
 - 497
 
1
            
            
        you must be using python2, you'll need:
696252 / 17500423.
                 ^ a decimal point
In python3, '/' is float division automatically, while in python2 it's integer division. To be consistent, use 1.0 * a / b when doing float division.
        zhangxaochen
        
- 32,744
 - 15
 - 77
 - 108