Difference between revisions of "CoCoA:Isqrt"

From ApCoCoAWiki
(pushing XML rev. 1.46, again)
 
(No difference)

Latest revision as of 10:02, 24 October 2007

Isqrt

(truncated) square root of an integer

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.

Example

  Isqrt(16);
4
-------------------------------
  Isqrt(99);
9
-------------------------------
  Isqrt(-1);
ERROR: Expected non-negative INT
CONTEXT: Isqrt(-1)
-------------------------------

Syntax

Isqrt(N:INT):INT
   <type>integer</type>
   <type>boolean</type>