示例#1
0
        public unsafe static Int256 operator /(Int256 left, Int256 right)
        {
            Int256 result = default;

            BigIntArithmetic.Div(&left.low, &right.low, &result.low, Size64);
            return(result);
        }
示例#2
0
        public unsafe static UInt128 operator *(UInt128 left, UInt128 right)
        {
            UInt128 result = default;

            BigIntArithmetic.Mul((uint *)&left.low, (uint *)&right.low, (uint *)&result.low, Size32);
            return(result);
        }
示例#3
0
        public unsafe static Int256 operator *(Int256 left, Int256 right)
        {
            Int256 result = default;

            BigIntArithmetic.Mul((uint *)&left.low, (uint *)&right.low, (uint *)&result.low, Size32);
            return(result);
        }
示例#4
0
        public unsafe static UInt128 operator /(UInt128 left, UInt128 right)
        {
            UInt128 result = default;

            BigIntArithmetic.Div(&left.low, &right.low, &result.low, Size64);
            return(result);
        }
示例#5
0
        // -1 to 1
        public static uint *NegAlloc(uint *src, int size)
        {
            uint *temp = (uint *)Marshal.AllocHGlobal(size << 2);

            BigIntArithmetic.NEG(src, temp, size);

            return(temp);
        }
示例#6
0
 public unsafe static Int128 operator ^(Int128 left, Int128 right)
 {
     BigIntArithmetic.XOR(&left.low, &right.low, Size64);
     return(left);
 }
示例#7
0
 public unsafe static Int256 operator -(Int256 left, Int256 right)
 {
     BigIntArithmetic.Sub((uint *)&left.low, (uint *)&right.low, Size32);
     return(left);
 }
示例#8
0
 public unsafe static UInt256 operator ^(UInt256 left, UInt256 right)
 {
     BigIntArithmetic.XOR(&left.low, &right.low, Size64);
     return(left);
 }
示例#9
0
 public unsafe int CompareTo(Int256 other)
 {
     fixed(ulong *ptr = &low)
     return(BigIntArithmetic.CompareTo(ptr, &other.low, Size64));
 }
示例#10
0
 public unsafe string ToString(string format)
 {
     fixed(ulong *ptr = &low)
     return(BigIntArithmetic.FormatString((uint *)ptr, Size32, Signed, format));
 }
示例#11
0
 public unsafe static Int256 operator -(Int256 value)
 {
     BigIntArithmetic.NEG((uint *)&value.low, (uint *)&value.low, Size32);
     return(value);
 }
示例#12
0
 public unsafe static Int256 operator &(Int256 left, Int256 right)
 {
     BigIntArithmetic.AND(&left.low, &right.low, Size64);
     return(left);
 }
示例#13
0
 public unsafe static UInt256 operator +(UInt256 left, UInt256 right)
 {
     BigIntArithmetic.Add((uint *)&left.low, (uint *)&right.low, Size32);
     return(left);
 }
示例#14
0
 public unsafe static Int128 operator +(Int128 left, Int128 right)
 {
     BigIntArithmetic.Add((uint *)&left.low, (uint *)&right.low, Size32);
     return(left);
 }
示例#15
0
 public unsafe static UInt128 operator -(UInt128 value)
 {
     BigIntArithmetic.NEG((uint *)&value.low, (uint *)&value.low, Size32);
     return(value);
 }
示例#16
0
 public unsafe static UInt128 operator -(UInt128 left, UInt128 right)
 {
     BigIntArithmetic.Sub((uint *)&left.low, (uint *)&right.low, Size32);
     return(left);
 }
示例#17
0
 public unsafe static UInt128 operator &(UInt128 left, UInt128 right)
 {
     BigIntArithmetic.AND(&left.low, &right.low, Size64);
     return(left);
 }