+ 1

why 10/2=5.0

28th Sep 2016, 5:51 PM
dobrij Celovek
dobrij Celovek - avatar
3 Answers
+ 1
Because the forward slash (/) operator stores (or outputs) the results in data type float.
28th Sep 2016, 6:42 PM
Ghaus Rabbani
+ 1
Using "/" converts the output data into 'float type'
28th Sep 2016, 7:17 PM
Md Rashid
Md Rashid - avatar
0
if you have to divide ints and not let them convert, you can use the floor division (//) but it will lose any remainder from the operation. eg, 24//5 is 4, the remainder of 4 is dropped.
28th Sep 2016, 10:39 PM
Luke Armstrong