Set the boolean b to true if the integer n is a square number, false otherwiseE.g. 2025 → true
b := number mod (round(sqrt(number)) = 0;
math
b := round(sqrt(n)) ** 2 = n;
import static java.lang.Math.sqrt;
boolean b = sqrt(n) % 1 == 0;
import math
b = math.sqrt(n).is_integer()
class Integer def perfect_square? Integer.sqrt(self)**2 == self end end b = n.perfect_square?
No security, no password. Other people might choose the same nickname.