Decimals
Compare Decimals
Compare 0.6 and 0.58 by padding the shorter decimal with a zero (0.6 → 0.60) so both have the same number of decimal places, then compare digit by digit: 0.60 > 0.58.
Example
compare-decimals.math
0.6 and 0.58
step: pad 0.6 as 0.60
step: 0.60 > 0.58
step: 0.6 > 0.58
compare-decimals
To compare decimals, first pad the shorter one with trailing zeros so both have the same number of decimal places. Then compare the digits from left to right as you would for whole numbers.