title: The most efficient way to reverse a number
body: <p>I am looking for an efficient algorithm to reverse a number, e.g.</p>
  
  <p><strong>Input:</strong> 3456789</p>
  
  <p><strong>Output:</strong> 9876543</p>
  
  <p>In C++ there are plenty of options with shifting and bit masks but what would be the most efficient way ?</p>
  
  <p>My platform: x86_64</p>
  
  <p>Numbers range: XXX - XXXXXXXXXX (3 - 9 digits)</p>
  
  <p><strong>EDIT</strong>
  Last digit of my input will never be a zero so there is no leading zeros problem.</p>