Exemple #1
0
        public static IntegerNumber operator -(IntegerNumber number)
        {
            if (number.bits[number.bits.Length - 1] == SignBit && number.isZero(0, number.bits.Length - 1))
            {   //make positive the highly compact negative numbers - as a special case.
                ulong[] bits = new ulong[number.bits.Length + 1];
                bits[number.bits.Length - 1] = SignBit;
                return(new IntegerNumber(bits, false));
            }
            IntegerNumber result = new IntegerNumber(number.bits, true);

            AsmX64Operations.Negate(result.bits, result.Digits);
            return(result);
        }