• This function performs a circular shift to an array. Positive values of shifts will shift to the right and negative values will do to the left.

    Parameters

    • array: NumberArray

      array

    • shift: number

      shift

    Returns Float64Array

    • rotated array

    Example

    xRotate([1,2,3,4],1) -> [4,1,2,3]
    

    Example

    xRotate([1,2,3,4],-1) -> [2,3,4,1]