示例#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);
		}
示例#2
0
		public static SimpleNums getInstance(int MaxValue=100000)
		{
			if (instance == null)
			{
				instance = new SimpleNums(MaxValue);
			}
			return instance;
		}
示例#3
0
		// метод упрощения дроби
		protected void simplify()
		{
			int FractionNOD = SimpleNums.getInstance().NOD(Numerator, Denomenator);
			Numerator = Numerator / FractionNOD;
			Denomenator = Denomenator / FractionNOD;
		}
示例#4
0
 private void Form1_Activated(object sender, EventArgs e)
 {
     SimpleNums.getInstance();
 }