Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

sqrt

sqrt

type: function (subr) 
location: built-in
source file: xlmath.c
Common LISP compatible: similar
supported on: all machines

SYNTAX

(sqrt <expr> )
        <expr>          -       floating point number/expression

DESCRIPTION

The SQRT function calculates the square root of <expr> and returns this result.

EXAMPLES

(sqrt 1.0)                              ; returns 1
(sqrt 2.0)                              ; returns 1.41421
(sqrt 3.0)                              ; returns 1.73205
(sqrt 4.0)                              ; returns 2
(sqrt 5.0)                              ; returns 2.23607
(sqrt -1.0)                             ; error: sqrt of a neg. number 
(sqrt 2)                                ; error: bad integer operation

COMMON LISP COMPATIBILITY: Common LISP allows for integer numbers, which XLISP does not support for SQRT.


Go to the first, previous, next, last section, table of contents.