예제 #1
0
        public static object __new__(CodeContext context, PythonType cls, string s, int radix) {
            int start = 0;
            if (radix == 16 || radix == 8 || radix == 2) {
                start = s.Length - Int32Ops.TrimRadix(s, radix).Length;
            }

            if (cls == TypeCache.BigInteger) {
                return ParseBigIntegerSign(s, radix, start);
            } else {
                BigInteger res = ParseBigIntegerSign(s, radix);
                return cls.CreateInstance(context, res);
            }
        }
예제 #2
0
        public static object __new__(CodeContext context, PythonType cls, string s, int radix)
        {
            var value = LiteralParser.ParseBigIntegerSign(s, radix, Int32Ops.FindStart(s, radix));

            if (cls == TypeCache.BigInteger)
            {
                return(value);
            }
            else
            {
                return(cls.CreateInstance(context, value));
            }
        }
예제 #3
0
 public static object __getnewargs__(CodeContext context, int self)
 {
     return(PythonTuple.MakeTuple(Int32Ops.__new__(context, TypeCache.Int32, self)));
 }
예제 #4
0
 public static int ExclusiveOr(bool x, int y)
 {
     return(Int32Ops.ExclusiveOr(x ? 1 : 0, y));
 }
예제 #5
0
 public static int ExclusiveOr(int x, bool y)
 {
     return(Int32Ops.ExclusiveOr(y ? 1 : 0, x));
 }
예제 #6
0
 public static int BitwiseOr(bool x, int y)
 {
     return(Int32Ops.BitwiseOr(x ? 1 : 0, y));
 }
예제 #7
0
 public static int BitwiseOr(int x, bool y)
 {
     return(Int32Ops.BitwiseOr(y ? 1 : 0, x));
 }