Make sure they are all of the same number of digits by adding zeros( 0) to the ones that are less. The highest digits in all the above numbers is 4 , hence 2.4 becomes 2.400 and 1.12 becomes 1.120 , the trailing zeros doesn't have any effect on the numbers but makes the calculation easier