Exemple #1
0
 public Fraction Power(double y)
 {
     var tmp_y = new Fraction(y);
     return Power(tmp_y);
 }
Exemple #2
0
 /// <summary>
 /// 通分を行う。
 /// </summary>
 /// <param name='other'>
 /// 通分をする対象。
 /// </param>
 public Fraction Reduce(Fraction other)
 {
     var lcm = Utilities.CalcLCM(Denominator, other.Denominator);
     Numerator *= lcm / Denominator;
     return new Fraction(other.Numerator * lcm / other.Denominator, lcm);
 }
Exemple #3
0
 public Fraction Power(long y)
 {
     var tmp_y = new Fraction((BigInteger)y);
     return Power(tmp_y);
 }
Exemple #4
0
 public Fraction Power(BigInteger y)
 {
     var tmp_y = new Fraction(y);
     return Power(tmp_y);
 }
Exemple #5
0
 public static Fraction operator /(Fraction lhs, double rhs)
 {
     var rhs_inversed = new Fraction(rhs).GetInverse();
     return lhs * rhs_inversed;
 }
Exemple #6
0
 public Fraction Power(Fraction y)
 {
     return new Fraction(0, 0);
 }
Exemple #7
0
 public static Fraction operator /(Fraction lhs, long rhs)
 {
     var rhs_inversed = new Fraction(1, rhs);
     return lhs * rhs_inversed;
 }
Exemple #8
0
 public static Fraction operator +(Fraction lhs, double rhs)
 {
     Fraction tmp = lhs, other = new Fraction(rhs);
     Fraction new_self = other.Reduce(tmp);
     new_self.Numerator = new_self.Numerator + other.Numerator;
     return new_self;
 }
Exemple #9
0
 public static Fraction operator *(Fraction lhs, double rhs)
 {
     var other = new Fraction(rhs);
     return lhs * other;
 }
Exemple #10
0
 public static Fraction operator %(Fraction lhs, double rhs)
 {
     var rhs_fraction = new Fraction(rhs);
     return lhs % rhs_fraction;
 }
Exemple #11
0
 public static Fraction operator %(Fraction lhs, long rhs)
 {
     var rhs_fraction = new Fraction((BigInteger)rhs);
     return lhs % rhs_fraction;
 }