MathTop

is_square 函数

判断非负整数是否为完全平方数。

语法

  • is_square(n)
  • issquare(n)

参数与选项

n待判断的整数;负数返回 false。

示例

  1. 完全平方数is_square(144)返回 true。