title: How to compare large number in PHP?
body: <p>I confuse that how I aseert quite large number by PHPUnit.
  I wrote fibonacci number. But in case 100, I wrote below.</p>
  
  <pre><code>http://github.com/sanemat/kata-fibonacci-phpunit/commit/b6b2945d2eff1b95e7e25b8be8c7bff11098d44d
  </code></pre>
  
  <p>I expect this return TRUE.
  It failed.</p>
  
  <pre><code>http://www.php.net/manual/en/language.types.float.php
  </code></pre>
  
  <p>I understood 'never compare for equality.' and so how to aseert it?
  At the end, I compare with to_string each other.
  How to compare large number in PHP ?</p>
  
  <pre><code>http://github.com/sanemat/kata-fibonacci-phpunit/commit/70a0e47bc0737be47da8fe8726634edd851d940d
  </code></pre>
  
  <p>I feel it as bad smell. But I do not know better way.
  Please tell me how do you assert it?</p>
  
  <pre><code>====
  php &gt; $a = 354224848179261915075;
  php &gt; echo $a;
  3.5422484817926E+20
  php &gt; $b = 3.5422484817926E+20;
  php &gt; echo $b;
  3.5422484817926E+20
  php &gt; echo ($a == $b) ? 'TRUE' : 'FALSE';
  FALSE
  php &gt; echo gmp_cmp($a, $b);
  PHP Warning:  gmp_cmp(): Unable to convert variable to GMP - wrong type in php shell code on line 1
  php &gt; echo (strval($a) == strval($b)) ? 'TRUE' : 'FALSE';
  TRUE
  ====
  
  environment
  $ uname -a
  Linux localhost.localdomain 2.6.33.6-147.2.4.fc13.x86_64 #1 SMP Fri Jul 23 17:14:44 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
  $ php --version
  PHP 5.3.3 (cli) (built: Jul 22 2010 15:57:00) 
  Copyright (c) 1997-2010 The PHP Group
  Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
  </code></pre>