Пример #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);
 }