コード例 #1
0
        public static Int128 operator <<(Int128 a, int b)
        {
            Int128 c;

            UInt128.LeftShift(out c.v, ref a.v, b);
            return(c);
        }
コード例 #2
0
        public void Uint128LeftShiftLowOverflowTest2()
        {
            var n  = new UInt128(0UL, 1UL);
            var n2 = n.LeftShift(100);
            var sb = UInt128.FromBigInteger(BigInteger.One << 100);

            Assert.AreEqual(sb, n2);
        }
コード例 #3
0
        public void Uint128LeftShiftLowOverflowTest()
        {
            var n  = new UInt128(0UL, UInt64.MaxValue);
            var n2 = n.LeftShift(1);

            Assert.AreEqual(1UL, n2.High);
            Assert.AreEqual(18446744073709551614UL, n2.Low);
        }
コード例 #4
0
 public static void LeftShift(ref Int128 c)
 {
     UInt128.LeftShift(ref c.v);
 }
コード例 #5
0
 public static void LeftShift(ref Int128 c, int d)
 {
     UInt128.LeftShift(ref c.v, d);
 }