public bool isIllegal(Rational rat) { bool isillegal; if (rat.denominator == 0) { isillegal = true; } else { isillegal = false; } return isillegal; }
public void IncreaseBy(Rational input) { int numtemp = numerator, dentemp = denominator; int innumtemp = input.numerator, indentemp = input.denominator; numtemp *= input.denominator; dentemp *= input.denominator; innumtemp *= denominator; indentemp *= denominator; numtemp += innumtemp; dentemp += indentemp; numerator = numtemp; denominator = dentemp; }