I know people have answered your question but in layman terms:
5 / 2 = 2
//since both 5 and 2 are integers and integers division always truncates decimals
5.0 / 2 or 5 / 2.0 or 5.0 /2.0 = 2.5
//here either 5 or 2 or both has decimal hence the quotient you will get will be in decimal.