| square(3scm) | Scheme Programmer's Manual | square(3scm) |
NAME
square - multiply a number by itself
LIBRARY
(import (scheme base)) ;R7RS
SYNOPSIS
(square z)
DESCRIPTION
Returns the square of z. This is equivalent to (* z z).
RETURN VALUES
Returns a single value which is a number.
EXAMPLES
(square 42) => 1764 (square 2.0) => 4.0
COMPATIBILITY
Only exists in R7RS. Can be replaced with (lambda (z) (* z z)).
ERRORS
It is an error for this procedure to be passed the wrong number of arguments, and it is an error if z is not a complex number object. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.
SEE ALSO
sqrt(3scm), expt(3scm), *(3scm)
STANDARDS
R7RS
HISTORY
The square procedure first appears in R7RS.
AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.
| 2022-04-05 |