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

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

            Initialize(temp.Numerator, temp.Denominator);
        }
Example #4
0
 public static MatrixClass operator /(MatrixClass MatrixClass1, int iNo)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.Inverse(new Fraction(iNo))));
 }
Example #5
0
 public static MatrixClass operator /(MatrixClass MatrixClass1, double dbl)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.Inverse(Fraction.ToFraction(dbl))));
 }
Example #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));
 }
Example #7
0
 public static MatrixClass operator *(double dbl, MatrixClass MatrixClass1)
 {
     return(MatrixClass.Multiply(MatrixClass1, Fraction.ToFraction(dbl)));
 }
Example #8
0
 public static Fraction operator /(Fraction frac1, double dbl)
 {
     return(Multiply(frac1, Fraction.Inverse(Fraction.ToFraction(dbl))));
 }
Example #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);
        }
Example #10
0
 public static Fraction operator /(double dbl, Fraction frac1)
 {
     return(Multiply(Inverse(frac1), Fraction.ToFraction(dbl)));
 }
Example #11
0
 public static Fraction operator *(double dbl, Fraction frac1)
 {
     return(Multiply(frac1, Fraction.ToFraction(dbl)));
 }
Example #12
0
 public static Fraction operator -(Fraction frac1, double dbl)
 {
     return(Add(frac1, -Fraction.ToFraction(dbl)));
 }
Example #13
0
 public static Fraction operator -(double dbl, Fraction frac1)
 {
     return(Add(-frac1, Fraction.ToFraction(dbl)));
 }
Example #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);
 }