title: I'm can't quite wrap my head around this code for checking for a perfect square
body: <p>I'm a novice as may be obvious, in advanced c++ at my school and I was working on home work and was having issues with try to figure out how to decide if an integer is a perfect square or not when I stumbled across this piece of code. </p>
  
  <pre><code>if (num &lt;= 0 || sqrt(num) != static_cast&lt;int&gt;(sqrt(num)))
        throw "Error: The number is not a perfect square.\n";
  
      return sqrt(num);
  </code></pre>
  
  <p>If possible  as an exception function I just don't quite understand how the piece after || works. And would just like to know for future reference. </p>