Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

IntegerReverse

IntegerReverse[n]
gives the integer whose digits are reversed with respect to those of the integer n.

IntegerReverse[n,b]
gives the integer whose digits in base b are reversed with respect to those of n.

IntegerReverse[n,b,len]
gives the integer with reversed digits after padding n with zeros on the left to have len digits.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Reverse the digits of an integer:

In[1]:=
Click for copyable input
Out[1]=

Reverse the binary digits of an integer:

In[1]:=
Click for copyable input
Out[1]=

The result coincides with the input because that number is a binary palindrome:

In[2]:=
Click for copyable input
Out[2]=

Reverse the digits of an integer after padding it with zeros on the left:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2015
(10.3)