示例#1
0
        public Fraction(string strValue)
        {
            Fraction temp = ToFraction(strValue);

            Initialize(temp.Numerator, temp.Denominator);
        }
示例#2
0
 public static MatrixClass operator /(MatrixClass MatrixClass1, Fraction frac)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.Inverse(frac)));
 }
示例#3
0
        public Fraction(double dDecimalValue)
        {
            Fraction temp = ToFraction(dDecimalValue);

            Initialize(temp.Numerator, temp.Denominator);
        }
示例#4
0
 public static MatrixClass operator /(MatrixClass MatrixClass1, int iNo)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.Inverse(new Fraction(iNo))));
 }
示例#5
0
 public static MatrixClass operator /(MatrixClass MatrixClass1, double dbl)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.Inverse(Fraction.ToFraction(dbl))));
 }
示例#6
0
 /// <summary>
 /// The function multiplies the given row of the current MatrixClass object by a double
 /// </summary>
 public void MultiplyRow(int iRow, double dbl)
 {
     this.MultiplyRow(iRow, Fraction.ToFraction(dbl));
 }
示例#7
0
 public static MatrixClass operator *(double dbl, MatrixClass MatrixClass1)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.ToFraction(dbl)));
 }
示例#8
0
 public static Fraction operator /(Fraction frac1, double dbl)
 {
     return(Multiply(frac1, Fraction.Inverse(Fraction.ToFraction(dbl))));
 }
示例#9
0
        /// <summary>
        /// checks whether two fractions are equal
        /// </summary>
        public override bool Equals(object obj)
        {
            Fraction frac = (Fraction)obj;

            return(Numerator == frac.Numerator && Denominator == frac.Denominator);
        }
示例#10
0
 public static Fraction operator /(double dbl, Fraction frac1)
 {
     return(Multiply(Inverse(frac1), Fraction.ToFraction(dbl)));
 }
示例#11
0
 public static Fraction operator *(double dbl, Fraction frac1)
 {
     return(Multiply(frac1, Fraction.ToFraction(dbl)));
 }
示例#12
0
 public static Fraction operator -(Fraction frac1, double dbl)
 {
     return(Add(frac1, -Fraction.ToFraction(dbl)));
 }
示例#13
0
 public static Fraction operator -(double dbl, Fraction frac1)
 {
     return(Add(-frac1, Fraction.ToFraction(dbl)));
 }
示例#14
0
 /// <summary>
 /// The function takes a Fraction object and returns its value as double
 /// </summary>
 public static double ToDouble(Fraction frac)
 {
     return((double)frac.Numerator / frac.Denominator);
 }