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.

expt

expt

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

SYNTAX

(expt <expr> [ <power> ... ] )
        <expr>          -       floating point number/expression
        <power>         -       integer or floating point number/expression

DESCRIPTION

The EXPT function raises the <expr> to the specified <power> and returns the result. If there is no <power> specified, the <expr> is returned. If there are multiple <power>'s, they will be applied sequentially to <expr>.

EXAMPLES

(expt 2.0 2)                            ; returns 4
(expt 2.0 10)                           ; returns 1024
(expt 2 2)                              ; error: bad integer operation
(expt 99.9)                             ; returns 99.9
(expt 2.0 2.0 2.0)                      ; returns 16

NOTE: EXPT with a large values like (expt 999.9 999.9) causes an incorrect value to be generated, with no error. The returned value will be a very large floating point number near the computer's limit (something like 1.79000e+308).


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