title: Io Language Fibonacci Problems
body: <p>I'm working on an Io problem that involves the Fibonacci sequence. I'm trying to create a method that tests if a number is a Fibonacci number or not. I can't figure out why my IsAFib method isn't working, does anyone know why and what I can do to fix it? I'm really new to Io, and pretty new to programming too, so if you could be descriptive with your reasons for changing things, I would really appreciate it! I want to know what it needs to be different, not just what it should be written as.</p>
  
  <pre><code>            OperatorTable addOperator("xor", 11)
              true xor := method(bool, if(bool, false, true))
              false xor := method(bool, if(bool, true, false)) 
  
              doFile("isASquare.io");
  </code></pre>
  
  <p>Then the isASquare.io file:</p>
  
  <pre><code>            isASquare := method(n,                    
                      for(i, 1, n, 
                          if(i * i == n, return true)
                          if(i * i &gt; n, return false)
                      )
              )
  
              isAFib := method(n,
                      if(isASquare(2 ** 5 * n) xor isASquare(2 ** n * 5 - 4), return true, return false)
              )
  </code></pre>