when i am dividing any no. by other, than they are not showing float instead they are showing lowest integer in result. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

when i am dividing any no. by other, than they are not showing float instead they are showing lowest integer in result.

>>>2/4 0

22nd Aug 2016, 5:08 PM
Rahul
Rahul - avatar
5 Answers
+ 1
Try 2.0/4.0
22nd Aug 2016, 5:53 PM
John Doe
John Doe - avatar
0
2
23rd Aug 2016, 9:06 AM
Manimaran
Manimaran - avatar
0
any one should in float..
30th Aug 2016, 9:10 PM
Prasanna Venkatesh Singh
Prasanna Venkatesh Singh - avatar
0
1. 2.0/4 2. 2/0.4 3. float(2)/4 4. 2/float(4) 5. float(2)/float(4) all these combination will give desired output
1st Sep 2016, 2:44 PM
arvindh
arvindh - avatar
0
Just add a decimal to the number.. Like so 7.0/2 or 7/0.3 You know whatever floats your boat
6th Sep 2016, 7:14 AM
Muerte Exe
Muerte Exe - avatar