title: Search positive and negative space for second decimal point float palindrome operation in Python
body: <p>This code takes a float as input, for instance a number like <code>1.01</code>, then it multiplies it by a constant. </p>
  
  <p>Subsequently it seeks out the closest numerical palindrome to that number. </p>
  
  <p><strong>However</strong></p>
  
  <p>At this point it only searches in one direction, it only increments the number-- what I'm trying to do is to get it to search in the positive direction and the negative direction simultaneously (<em>(or at least in quick succession</em>). </p>
  
  <p>Checkout the way it works now, maybe a bit naive: </p>
  
  <pre><code>import sys
  
  # This method determines whether or not the number is a Palindrome
  def isPalindrome(x):
      x = str(x).replace('.','')
      a, z = 0, len(x) - 1
      while a &lt; z:
          if x[a] != x[z]:
              return False
          a += 1
          z -= 1
      return True
  
  if '__main__' == __name__:
  
      trial = float(sys.argv[1])
  
      candidrome = trial + (trial * 0.15)
  
      print(candidrome)
      candidrome = round(candidrome, 2)
  
  
      # check whether we have a Palindrome
      while not isPalindrome(candidrome):
          candidrome += 0.01
          candidrome = round(candidrome, 2)
          print(candidrome)
  
      if isPalindrome(candidrome):
          print( "It's a Palindrome! " + str(candidrome) )
  </code></pre>
  
  <p>I've been attempting to insert these functions somewhere into my loop: </p>
  
  <pre><code>def incrementer(candidrome):
      candidrome += 0.01
      candidrome = round(candidrome, 2)
      return candidrome
  
  def decrementer(candidrome):
      candidrome -= 0.01
      candidrome = round(candidrome, 2)
      return candidrome
  </code></pre>
  
  <p>But I've not been able to pin it down yet. How to exhaustively search the positive and negative space for the <em>closest</em> (in numberline distance) numerical palindrome? </p>