コード例 #1
0
 /// <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));
 }
コード例 #2
0
 /// <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);
 }