Fundamentals of CS I (CS151 2001S) : Reference

expt: exponentiation

Procedureexpt
Parametersn, a number
p a number
PurposeComputes np.
ProducesA number equal to np.
PreconditionsOnly two parameters (verified).
Both parameters are numbers (verified).
PostconditionsThe result is a number. It may be an imaginary number.
Examples
> (expt 2 3)
8
> (expt 3 2)
9
> (expt 2 1/2)
1.4142135623730951
> (sqrt 2)
1.4142135623730951
> (expt -1 1/2)
6.123233995736766e-17+1.0i

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Thu Feb 22 05:47:59 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2001S/expt.html.
You may validate this page's HTML.
The source was last modified Fri Jan 26 00:01:26 2001.