Scheme Programmer's Manual
NAME
* - multiplication
LIBRARY
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
SYNOPSIS
(* number ...)
DESCRIPTION
This procedure returns the product of its arguments.
IMPLEMENTATION NOTES
- Chez Scheme
-
An exact zero is returned when any of the arguments to
*
is an exact zero.
RETURN VALUES
The return value is exact if all arguments are exact. If any
argument is inexact then the result is inexact, unless one of the
arguments is an exact zero, in which case the return value can
optionally be an exact zero.
In non-R6RS implementations
EXAMPLES
; Examples apply to R6RS. An R5RS/R7RS implementation
; might e.g. not provide rational or complex numbers.
(* 6 7) => 42
(* 2 1/3) => 2/3
(* 2 1.57) => 3.14
(* 5 1+2i) => 5+10i
; Examples from R6RS
(* 4) => 4
(*) => 1
(* 5 +inf.0) => +inf.0
(* -5 +inf.0) => -inf.0
(* +inf.0 +inf.0) => +inf.0
(* +inf.0 -inf.0) => -inf.0
(* 0 +inf.0) => 0 or +nan.0
(* 0 +nan.0) => 0 or +nan.0
(* 1.0 0) => 0 or 0.0
COMPATIBILITY
R6RS is the only report on Scheme to require a full implementation of
the numeric tower.
In R7RS code, the feature identifiers
exact-closed,
exact-complex,
ieee-float,
and
ratios
should be consulted before performing arithmetic that requires
one of these features.
In R7RS, (* 0 +inf.0) may return 0, or +nan.0, or report that inexact
numbers are not supported, or report that non-rational real numbers
are not supported, or fail silently or noisily in other
implementation-specific ways.
ERRORS
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
-
An argument was outside its domain.
- &implementation-restriction (R6RS)
-
May be raised when applied to mixed non-rational real and non-real
complex arguments. Otherwise an unspecified number object is returned.
- R7RS
-
The assertions described above are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
SEE ALSO
+(3),
fx*(3)
STANDARDS
R4RS,
IEEE Scheme,
R5RS,
R6RS,
R7RS
AUTHORS
This page is part of the
scheme-manpages
project.
It includes materials from the RnRS documents.
More information can be found at
Index
- NAME
-
- LIBRARY
-
- SYNOPSIS
-
- DESCRIPTION
-
- IMPLEMENTATION NOTES
-
- RETURN VALUES
-
- EXAMPLES
-
- COMPATIBILITY
-
- ERRORS
-
- SEE ALSO
-
- STANDARDS
-
- AUTHORS
-
Return to Main Contents