Microsoft.Scripting.Utils.MathUtils.GetHighestByte C# (CSharp) Method

GetHighestByte() private static method

private static GetHighestByte ( System.Numerics.BigInteger self, int &index, byte &byteArray ) : byte
self System.Numerics.BigInteger
index int
byteArray byte
return byte
        private static byte GetHighestByte(BigInt self, out int index, out byte[] byteArray) {
            byte[] bytes = BigInt.Abs(self).ToByteArray();
            if (self.IsZero) {
                byteArray = bytes;
                index = 0;
                return 1;
            }

            int hi = bytes.Length;
            byte b;
            do {
                b = bytes[--hi];
            } while (b == 0);
            index = hi;
            byteArray = bytes;
            return b;
        }