emacs.d/clones/lisp/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node126.html

89 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>12.5. Irrational and Transcendental Functions</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Irrational and Transcendental Functions">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html3102 HREF="node127.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html3100 HREF="node121.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html3094 HREF="node125.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html3104 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html3105 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3103 HREF="node127.html"> Exponential and Logarithmic </A>
<B>Up:</B> <A NAME=tex2html3101 HREF="node121.html"> Numbers</A>
<B> Previous:</B> <A NAME=tex2html3095 HREF="node125.html"> Arithmetic Operations</A>
<HR> <P>
<H1><A NAME=SECTION001650000000000000000>12.5. Irrational and Transcendental Functions</A></H1>
<P>
<A NAME=TRANSCENDENTALSECTION>Common</A>
Lisp provides no data type that can accurately represent irrational
numerical values.
The functions in this section are described as if the results
were mathematically accurate, but actually they all produce floating-point
approximations to the true mathematical result in the general case.
In some places
mathematical identities are set forth that are intended to elucidate the
meanings of the functions; however, two mathematically identical
expressions may be computationally different because of errors
inherent in the floating-point approximation process.
<P>
When the arguments to
a function in this section are all rational and the true mathematical result
is also (mathematically) rational, then unless otherwise noted
an implementation is free to return either an accurate result of
type <tt>rational</tt> or a single-precision floating-point approximation.
If the arguments are all rational but the result cannot be expressed
as a rational number, then a single-precision floating-point
approximation is always returned.
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
X3J13 voted in March 1989
(COMPLEX-RATIONAL-RESULT) <A NAME=11759>&#160;</A>
to clarify that the provisions of the previous paragraph apply to complex
numbers. If the arguments to a function are all of type
<tt>(or rational (complex rational))</tt> and the true mathematical result
is (mathematically) a complex number with rational real
and imaginary parts, then unless otherwise noted
an implementation is free to return either an accurate result of
type <tt>(or rational (complex rational))</tt>
or a single-precision floating-point approximation
of type <tt>single-float</tt> (permissible only if the imaginary part
of the true mathematical result is zero) or <tt>(complex single-float)</tt>.
If the arguments are all of type
<tt>(or rational (complex rational))</tt> but the result cannot be expressed
as a rational or complex rational number, then the returned value
will be of type <tt>single-float</tt> (permissible only if the imaginary part
of the true mathematical result is zero) or <tt>(complex single-float)</tt>.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
The rules of floating-point contagion and complex contagion are
effectively obeyed by all the functions in this section except <tt>expt</tt>,
which treats some cases of rational exponents specially.
When, possibly after contagious conversion, all of the arguments are of
the same floating-point or complex floating-point type,
then the result will be of that same type unless otherwise noted.
<P>
<hr>
<b>Implementation note:</b> There is a ``floating-point cookbook'' by
Cody and Waite [<A HREF="node368.html#CODYANDWAITE">14</A>] that may be a useful aid
in implementing the functions defined in this section.
<hr>
<P>
<HR>
<UL>
<LI> <A NAME=tex2html3106 HREF="node127.html#SECTION001651000000000000000"> Exponential and Logarithmic Functions</A>
<LI> <A NAME=tex2html3107 HREF="node128.html#SECTION001652000000000000000"> Trigonometric and Related Functions</A>
<LI> <A NAME=tex2html3108 HREF="node129.html#SECTION001653000000000000000"> Branch Cuts, Principal Values, and Boundary Conditions in the Complex Plane</A>
</UL>
<BR> <HR><A NAME=tex2html3102 HREF="node127.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html3100 HREF="node121.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html3094 HREF="node125.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html3104 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html3105 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3103 HREF="node127.html"> Exponential and Logarithmic </A>
<B>Up:</B> <A NAME=tex2html3101 HREF="node121.html"> Numbers</A>
<B> Previous:</B> <A NAME=tex2html3095 HREF="node125.html"> Arithmetic Operations</A>
<HR> <P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>