Ad
  • Custom User Avatar

    He's checking to see if the sqrt() function has decimals by comparing the base sqrt(n) to the rounded down version (floor()) of sqrt(n). If they are equal and the function returns true, then sqrt(n) must have no decimals. Thus, n is a perfect square.