up previous next
FloorSqrt

(truncated) square root of an integer

Syntax
FloorSqrt(N: INT): INT

Description
This function computes the square root of an integer. If the argument is not a perfect square it returns the integer part of the square root.

This function was called isqrt up to version CoCoA-5.1.2.

Example
/**/  FloorSqrt(16);
4
/**/  FloorSqrt(99);
9
-- /**/  FloorSqrt(-1);  --> !!! ERROR !!! as expected
ERROR: Value must be non-negative
 FloorSqrt(-1);
 ^^^^^^^^^