コード例 #1
0
        public LexoInteger Ceil()
        {
            if (IsExact())
            {
                return(_mag);
            }

            var floor = Floor();

            return(floor.Add(LexoInteger.One(floor.GetSystem())));
        }
コード例 #2
0
        public LexoDecimal SetScale(int nSig, bool ceiling)
        {
            if (nSig >= _sig)
            {
                return(this);
            }

            if (nSig < 0)
            {
                nSig = 0;
            }

            var diff = _sig - nSig;
            var nmag = _mag.ShiftRight(diff);

            if (ceiling)
            {
                nmag = nmag.Add(LexoInteger.One(nmag.GetSystem()));
            }

            return(Make(nmag, nSig));
        }