计算一个数的平方。
对一个数求平方意味着将该数乘以自身。例如,sq(3)
计算的是 3 × 3,结果是 9。 sq(-3)
计算的是 -3 × -3,结果也是 9。两个负数相乘会得到一个正数。 sq()
返回的值始终为正数。
示例
语法
sq(n)
参数
n
数字:
要进行平方运算的数。
返回值
数字: 平方数。
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!