Google.Maps.PolylineEncoder.EncodeSignedNumber C# (CSharp) 메소드

EncodeSignedNumber() 개인적인 정적인 메소드

Encode a signed number in the encode format.
private static EncodeSignedNumber ( int num ) : string
num int The signed number
리턴 string
        private static string EncodeSignedNumber(int num)
        {
            int sgn_num = num << 1; //shift the binary value
            if(num < 0) //if negative invert
            {
                sgn_num = ~(sgn_num);
            }
            return (EncodeNumber(sgn_num));
        }