Core Fraction Operations

create_fraction(N,D)
Takes 2 integers and returns the fraction N/D.

get_numerator(F)
Takes a fraction and returns its numerator.

get_denominator(F)
Takes a fraction and returns its denominator.
Using these, we can define any other function on fractions, such as:
fraction ADD(fraction F1, fraction F2)
{ int n1  = get_numerator(F1);
      n2  = get_numerator(F2);
      d1  = get_denominator(F1);
      d2  = get_denominator(F2);
  return create_fraction( n1*d2+n2*d1 , d1*d2 ); }