CoCoA:Isqrt

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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>