IntIsPerfectSquare
IntIsPerfectSquare
Description
Test whether a value is a perfect square.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Value to test |
Usage example (from documentation)
bool square = IntIsPerfectSquare(&value);Returns
true when value = n^2 for some integer n.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1280:
}
bool IntIsPerfectSquare(Int *value) {
ValidateInt(value);- In
Int.Math.c:519:
bool test_int_is_perfect_square(void) {
WriteFmt("Testing IntIsPerfectSquare\n");
Int square = IntFrom(144);- In
Int.Math.c:524:
Int non_square = IntFrom(145);
bool result = IntIsPerfectSquare(&square);
result = result && !IntIsPerfectSquare(&non_square);- In
Int.Math.c:525:
bool result = IntIsPerfectSquare(&square);
result = result && !IntIsPerfectSquare(&non_square);
IntDeinit(&square);
Last updated on