[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.260 Sqr

Synopsis

 
function Sqr (i: integer type): integer type;
or
 
function Sqr (x: real type): real type;
or
 
function Sqr (z: Complex type): Complex type;

Description

Returns the square of the argument:

 
function Sqr (x: some type): some type;
begin
  Sqr := x * x  { or: x pow 2 }
end;

Conforming to

The function `Sqr' is defined in ISO-7185 Pascal; its application to complex values is defined in ISO-10206 Extended Pascal.

Example

 
program SqrDemo;

var i: Complex;

begin i := Cmplx (0, 1); WriteLn (Re (Sqr (i)) : 0 : 3) { yields -1.000 } end.

See also

section 9.200 pow, section 9.261 SqRt, section 9.1 Abs, section 8.3 Operators.



This document was generated by Frank Heckenbach on May, 10 2002 using texi2html