+ 1
Division in python
Hi can anyone help with a formula for division for example traveling an aero plane travels 5000 kilometers on 300 liters of fuel how many kilometers per liter? 5000 / 300 would like to use float or integer?
2 Antworten
+ 11
for java , u should use double or float type bcz integer/integer gives an integer value only
ie 5000/300 will be 18 in java
5000.0/300.0 will be 18.6666666666.....
+ 1
This will depend greatly on the language you're using, and will need to use a float type variable to hold the result (unless you're okay with some data loss, or want to round it).