implement remainder operation for rational numbers