public static Number ratioRemainder(Ratio x, Ratio y) {
   BigInteger q =
       x.getNumerator()
           .multiply(y.getDenominator())
           .divide(x.getDenominator().multiply(y.getNumerator()));
   return BigInt.fromBigInteger(q);
 }
 public static Number bigIntRemainder(BigInt x, BigInt y) {
   return x.remainder(y);
 }