+ 1
why 10/2=5.0
3 Answers
+ 1
Because the forward slash (/) operator stores (or outputs) the results in data type float.
+ 1
Using "/" converts the output data into 'float type'
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.