So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks:
Given an integer
n>=0) as input return a truthy value if
n is a perfect square or a falsey value if not.
- You may take input by any reasonable, convenient means as long as it's permitted by standard I/O rules.
- You need not handle inputs greater than what your chosen language can natively handle nor which would lead to floating point inaccuracies.
- Output should be one of two consistent truthy/falsey values (e.g.,
0) - truthy if the input is a perfect square, falsey if it's not.
- This is code-golf so lowest byte count wins.
Input: 0 Output: true Input: 1 Output: true Input: 64 Output: true Input: 88 Output: false Input: 2147483647 Output: false