Function zigzag

  • Perform zigzag encoding on the input number.

    Parameters

    • num: number

      the input

    Returns number

    • the incoded unsigned output