示例#1
0
 StoreTyped(uint value)
 {
     if (value <= Int32.MaxValue)
     {
         return(this.Store((int)value));
     }
     return(this.Store(NumberMaker.MakeBigInteger(this.scratchContext, value)));
 }
示例#2
0
        _PyLong_Sign(IntPtr valuePtr)
        {
            BigInteger value = NumberMaker.MakeBigInteger(this.scratchContext, this.Retrieve(valuePtr));

            if (value > 0)
            {
                return(1);
            }
            else if (value < 0)
            {
                return(-1);
            }
            return(0);
        }
示例#3
0
 PyInt_AsUnsignedLongMask(IntPtr valuePtr)
 {
     try
     {
         BigInteger unmasked = NumberMaker.MakeBigInteger(this.scratchContext, this.Retrieve(valuePtr));
         BigInteger mask     = new BigInteger(UInt32.MaxValue) + 1;
         BigInteger masked   = unmasked % mask;
         if (masked < 0)
         {
             masked += mask;
         }
         return((uint)masked);
     }
     catch (Exception e)
     {
         this.LastException = e;
         return(0xFFFFFFFF);
     }
 }