public Fraction Power(double y) { var tmp_y = new Fraction(y); return Power(tmp_y); }
/// <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); }
public Fraction Power(long y) { var tmp_y = new Fraction((BigInteger)y); return Power(tmp_y); }
public Fraction Power(BigInteger y) { var tmp_y = new Fraction(y); return Power(tmp_y); }
public static Fraction operator /(Fraction lhs, double rhs) { var rhs_inversed = new Fraction(rhs).GetInverse(); return lhs * rhs_inversed; }
public Fraction Power(Fraction y) { return new Fraction(0, 0); }
public static Fraction operator /(Fraction lhs, long rhs) { var rhs_inversed = new Fraction(1, rhs); return lhs * rhs_inversed; }
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; }
public static Fraction operator *(Fraction lhs, double rhs) { var other = new Fraction(rhs); return lhs * other; }
public static Fraction operator %(Fraction lhs, double rhs) { var rhs_fraction = new Fraction(rhs); return lhs % rhs_fraction; }
public static Fraction operator %(Fraction lhs, long rhs) { var rhs_fraction = new Fraction((BigInteger)rhs); return lhs % rhs_fraction; }