Exemple #1
0
 public static ScaleFactor UseIfValid(int numerator, int denominator, ScaleFactor lastResort)
 {
     if (numerator <= 0 || denominator <= 0)
     {
         return lastResort;
     }
     else
     {
         return new ScaleFactor(numerator, denominator);
     }
 }
Exemple #2
0
 public static ScaleFactor Min(int n1, int d1, int n2, int d2, ScaleFactor lastResort)
 {
     ScaleFactor a = UseIfValid(n1, d1, lastResort);
     ScaleFactor b = UseIfValid(n2, d2, lastResort);
     return ScaleFactor.Min(a, b);
 }
Exemple #3
0
 public static ScaleFactor Min(ScaleFactor lhs, ScaleFactor rhs)
 {
     if (lhs < rhs)
     {
         return lhs;
     }
     else
     {
         return rhs;
     }
 }
Exemple #4
0
 public static ScaleFactor Max(ScaleFactor lhs, ScaleFactor rhs)
 {
     if (lhs > rhs)
     {
         return lhs;
     }
     else
     {
         return lhs;
     }
 }