isPerfectSquare method

bool isPerfectSquare()

Returns whether this number is a perfect square.

A perfect square is a number that has an integer square root.

Implementation

bool isPerfectSquare() => sqrt() % 1 == 0;