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 (1)

Every input below was run against the current Mathilda build and its output recorded.

Applications (1)

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

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.

References

See also: RotateLeft

Notes & additional examples

Notes

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