Esempio n. 1
0
        public static SuperNumber operator -(SuperNumber number)
        {
            var res = new SuperNumber(-number.Suret, number.Mexrec);

            res.Normalize();
            return(res);
        }
Esempio n. 2
0
        public static SuperNumber operator /(ulong number1, SuperNumber number2)
        {
            var result = new SuperNumber(number2.Mexrec * number1, number2.Suret);

            result.Normalize();
            return(result);
        }
Esempio n. 3
0
        public static SuperNumber operator +(SuperNumber number1, float number2)
        {
            var num2 = new SuperNumber(number2.ToString(DefaultCultureInfo));
            var res  = number1 + num2;

            return(res);
        }
Esempio n. 4
0
        public static SuperNumber operator /(SuperNumber number1, ulong number2)
        {
            var result = new SuperNumber(number1.Suret, number1.Mexrec * number2);

            result.IxtisarEt();
            result.Normalize();
            return(result);
        }
Esempio n. 5
0
        public static SuperNumber operator *(SuperNumber number1, int number2)
        {
            var result = new SuperNumber(number1.Suret * number2, number1.Mexrec);

            result.IxtisarEt();
            result.Normalize();
            return(result);
        }
Esempio n. 6
0
        public static SuperNumber operator -(decimal number2, SuperNumber number1)
        {
            var num2 = new SuperNumber(number2.ToString(DefaultCultureInfo));
            var res  = num2 - number1;

            res.Normalize();
            return(res);
        }
Esempio n. 7
0
        public static SuperNumber operator -(SuperNumber number1, double number2)
        {
            var num2 = new SuperNumber(number2.ToString(DefaultCultureInfo));
            var res  = number1 - num2;

            res.Normalize();
            return(res);
        }
Esempio n. 8
0
        public static SuperNumber operator +(float number2, SuperNumber number1)
        {
            var num2 = new SuperNumber(number2.ToString(DefaultCultureInfo));
            var res  = number1 + num2;

            res.Normalize();
            return(res);
        }
Esempio n. 9
0
        public static SuperNumber Sqrt(SuperNumber number)
        {
            var sqrtNumber = number / 2;

            for (var i = 0; i < IterationCount; i++)
            {
                sqrtNumber = ((sqrtNumber + number / sqrtNumber) / new SuperNumber("2.0"));
            }
            return(sqrtNumber);
        }
Esempio n. 10
0
        public static SuperNumber Sqrt(ulong numberint)
        {
            var number     = new SuperNumber(numberint.ToString(DefaultCultureInfo));
            var sqrtNumber = number / 2;

            for (var i = 0; i < IterationCount; i++)
            {
                sqrtNumber = ((sqrtNumber + number / sqrtNumber) / new SuperNumber("2.0"));
            }
            return(sqrtNumber);
        }
Esempio n. 11
0
        public static SuperNumber operator -(SuperNumber number1, ulong number2)
        {
            /*
             * a/b-c=(a-bc)/b
             */
            var newsuret = number1.Suret - number1.Mexrec * number2;
            var result   = new SuperNumber(newsuret, number1.Mexrec);

            result.IxtisarEt();
            result.Normalize();
            return(result);
        }
Esempio n. 12
0
        public static SuperNumber operator +(SuperNumber number1, int number2)
        {
            /*
             * a/b+c=(a+bc)/b
             */
            var newsuret = number1.Suret + number1.Mexrec * number2;
            var result   = new SuperNumber(newsuret, number1.Mexrec);

            result.IxtisarEt();
            result.Normalize();
            return(result);
        }
Esempio n. 13
0
        public static SuperNumber operator /(SuperNumber number1, SuperNumber number2)
        {
            /*
             * a/b /  c/d=ad/bc
             */
            var newmexrec = number1.Mexrec * number2.Suret;
            var newsuret  = number1.Suret * number2.Mexrec;
            var result    = new SuperNumber(newsuret, newmexrec);

            result.IxtisarEt();
            result.Normalize();
            return(result);
        }
Esempio n. 14
0
        private static SuperNumber exp_0_1(SuperNumber x)
        {
            /*
             * s=1
             * s=s*(1+x/4)  s=1+x/4
             * s=s*()
             */
            //exp(x)=1+x*(1+x/2*(1+x/3*(1+x/4)))

            var         i = IterationCount;
            SuperNumber s = 1;

            while (i > 0)
            {
                s = 1 + s * x / i;
                i--;
            }
            return(s);
        }
Esempio n. 15
0
        private static SuperNumber exp_int(BigInteger quvvet)
        {
            var         bigInteger = quvvet;
            SuperNumber y          = 1;
            var         z          = E;
            BigInteger  qaliq;

A2:
            bigInteger = BigInteger.DivRem(bigInteger, 2, out qaliq);
            if (qaliq == 0)
            {
                goto A5;
            }
            y = y * z;
            if (bigInteger == 0)
            {
                return(y);
            }
A5:
            z = z * z;
            goto A2;
        }
Esempio n. 16
0
 public static SuperNumber Exp(SuperNumber xNumber)
 {
     return(null);
 }