Fraction representation and calculation