Equivalent of Java triple shift operator (>>>) in C#?

前端 未结 6 2105
轻奢々
轻奢々 2020-12-15 17:10

What is the equivalent (in C#) of Java\'s >>> operator?

(Just to clarify, I\'m not referring to the >> and <<

6条回答
  •  悲&欢浪女
    2020-12-15 17:27

    There is no >>> operator in C#. But you can convert your value like int,long,Int16,Int32,Int64 to unsigned uint, ulong, UInt16,UInt32,UInt64 etc.

    Here is the example.

        private long getUnsignedRightShift(long value,int s)
        {
            return (long)((ulong)value >> s);
        }
    

提交回复
热议问题