title: Implement pow(x, n)
body: <p>Why does this function give the wrong answer <code>-1</code> rather than the right answer <code>1</code> when I try this? <code>myPow(-1.00000, -2147483648)</code></p>
  
  <pre><code>double QuickPower(double x, int n) 
  {
      if(n==0){
          return 1;
      }
  
      if(n==1){
          return x;
      }
  
      if(n&gt;=2){
          int res=n%2;
          double half=QuickPower(x,n/2);
          return res? Half*half*x: half*half;
      }
  }
  
  double myPow(double x, int n) {
      return n&gt;=0? QuickPower(x,n):(1/QuickPower(x,-n));
  }
  </code></pre>
  
  <p>I just try to run the code below. "Hello World" is printed out. 
  Here I did't specify data type but it still pass if statement. Why?<br>
  <code>if (-1 &gt; 2147483648)
  {
   cout &lt;&lt; "Hello World";
  }</code>                       </p>