Beispiel #1
0
        public BigNumber Ceil()
        {
            BigNumber dst = new BigNumber();

            BigNumber.Ceil(dst, this);
            return(dst);
        }
        static int M_exp_compute_nn(ref int n, BigNumber b, BigNumber a)
        {
            BigNumber tmp0, tmp1;

            String cp = "";
            int    kk;

            n = 0;

            tmp0 = new BigNumber();
            tmp1 = new BigNumber();

            BigNumber.Mul(BN_exp_log2R, a, tmp1);

            if (tmp1.signum >= 0)
            {
                BigNumber.Add(tmp1, BigNumber.BN_OneHalf, tmp0);
                BigNumber.Floor(tmp1, tmp0);
            }
            else
            {
                BigNumber.Sub(tmp1, BigNumber.BN_OneHalf, tmp0);
                BigNumber.Ceil(tmp1, tmp0);
            }

            kk = tmp1.exponent;


            cp = BigNumber.ToIntString(tmp1);
            n  = Convert.ToInt32(cp);

            BigNumber.SetFromLong(b, (long)(n));

            kk = BigNumber.Compare(b, tmp1);

            return(kk);
        }