Beispiel #1
0
		public Fraction subtraction(Fraction FractionObj)
		{
			int den = SimpleNums.getInstance().NOK(Denomenator, FractionObj.getDenomenator());
			int num = Numerator * (den / Denomenator);
			int num2 = FractionObj.getNumerator() * (den / FractionObj.getDenomenator());
			return new Fraction((num - num2), den);
		}
Beispiel #2
0
		public static SimpleNums getInstance(int MaxValue=100000)
		{
			if (instance == null)
			{
				instance = new SimpleNums(MaxValue);
			}
			return instance;
		}
Beispiel #3
0
		// метод упрощения дроби
		protected void simplify()
		{
			int FractionNOD = SimpleNums.getInstance().NOD(Numerator, Denomenator);
			Numerator = Numerator / FractionNOD;
			Denomenator = Denomenator / FractionNOD;
		}
Beispiel #4
0
 private void Form1_Activated(object sender, EventArgs e)
 {
     SimpleNums.getInstance();
 }