/// <summary> /// Whether this rational can be factored, factors it even if it is already in lowest terms /// </summary> /// <param name="factored"></param> /// <returns></returns> public bool TryFactor(out Rational <T> factored) { factored = Factor(); return(factored.EqualsExactly(this)); }
/// <summary> /// Check if the numerator and denominators match, without trying to factor /// </summary> /// <param name="other"></param> /// <returns></returns> public bool EqualsExactly(Rational <T> other) { return(Num == other.Num && Den == other.Den); }