Skip to content

RotateRight

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

RotateRight[expr, n] rotates the elements of expr n positions to the right.

Examples

No verified examples yet for this function.

Implementation notes

Algorithm. builtin_rotateright cyclically shifts elements toward the back by n (default 1). It negates the shift spec (an integer or a per-level List of integers) and delegates to the same rotate_rec worker used by RotateLeft, so the offset wrapping and per-level nested behaviour are identical with the opposite sign.

Attributes: Protected.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References

Notes & additional examples

Worked examples

In[1]:= RotateRight[{1,2,3,4},1]
Out[1]= {4, 1, 2, 3}

Notes

Cyclically shifts elements n positions to the right; it is the inverse of RotateLeft.