title: How are floating point operations handled in php
body: <p>I'm aware of the errors with loss of precision that can happen with floating point errors. But I'm not really sure of when and how it's using floating point representations. I feel like my question is best represented by the following shell session:</p>
  
  <pre><code>php &gt; $a = 819.94 - 61.67;
  php &gt; $b = 758.27;
  php &gt; echo $a;
  758.27
  php &gt; echo $b;
  758.27
  php &gt; echo $a == $b;
  php &gt; echo (string)$a == (string)$b;
  1
  php &gt; var_dump($a);
  double(758.27)
  php &gt; var_dump($b);
  double(758.27)
  </code></pre>
  
  <p>How is this even possible? </p>
  
  <p>Specifically, how are the string representations being determined? == is supposed to be typeless compare. I don't see how casting before comparing should change the values at all.</p>
  
  <p>Also, the var_dumps are showing me an identical value. It doesn't seem unreasonable for me to expect that if the value returned by 2 var_dumps are identical, that the 2 values should be equal.</p>