title: Square root in PHP
body: <p>Why is the output of <code>sqrt</code> not an integer for "16" in PHP?</p>
  
  <p>Example</p>
  
  <pre><code>php &gt; $fig = 16;
  php &gt; $sq = sqrt($fig); //should be 4
  php &gt; echo $sq;
  4
  php &gt; echo is_int($sq);            // should give 1, but gives false
  php &gt; 
  </code></pre>
  
  <p>I feel that the problem is in the internal presentation which PHP hides similarly as Python.
  How can you then know when the given figure is integer after taking a square root?</p>
  
  <p>So how can you differentiate between <code>4</code> and <code>4.12323</code> in PHP without using a regex?</p>