Java Zigzag Decode zigZagDecode(int i)

Here you can find the source of zigZagDecode(int i)

Description

Decode an int previously encoded with #zigZagEncode(int) .

License

Apache License

Declaration

private static final int zigZagDecode(int i) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** Decode an int previously encoded with {@link #zigZagEncode(int)}. */
    private static final int zigZagDecode(int i) {
        return ((i >>> 1) ^ -(i & 1));
    }//from w ww .  j ava2 s .c  om

    /** Decode a long previously encoded with {@link #zigZagEncode(long)}. */
    private static final long zigZagDecode(long l) {
        return ((l >>> 1) ^ -(l & 1));
    }
}

Related

  1. zigzagDecode(int encoded)
  2. zigzagDecode(int encoded)
  3. zigzagDecode(int[] src)
  4. zigZagDecode(long n)
  5. zigzagDecode(long val)