I'm can't quite wrap my head around this code for checking for a perfect square. : 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. 
if (num <= 0 || sqrt(num) != static_cast<int>(sqrt(num)))
      throw "Error: The number is not a perfect square.\n";

	return sqrt(num);

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. 