1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/t_comple.htm

57 lines
6.4 KiB
HTML
Raw Normal View History

2024-04-01 10:24:07 +02:00
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: System Class COMPLEX</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="t_number.htm">
<LINK REL=UP HREF="c_number.htm">
<LINK REL=NEXT HREF="t_real.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="t_number.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_number.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="t_real.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<A NAME="complex"><I>System Class</I> <B>COMPLEX</B></A> <P>
<P><B>Class Precedence List:</B><P>
<A REL=DEFINITION HREF="#complex"><B>complex</B></A>, <A REL=DEFINITION HREF="t_number.htm#number"><B>number</B></A>, <A REL=DEFINITION HREF="t_t.htm#t"><B>t</B></A> <P>
<P><B>Description:</B><P>
<P>
The <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="#complex"><B>complex</B></A> includes all mathematical complex numbers other than those included in the <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="t_ration.htm#rational"><B>rational</B></A>. <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>Complexes</I></A> are expressed in Cartesian form with a real part and an imaginary part, each of which is a <A REL=DEFINITION HREF="t_real.htm#real"><I>real</I></A>. The real part and imaginary part are either both <A REL=DEFINITION HREF="26_glo_r.htm#rational"><I>rational</I></A> or both of the same <A REL=DEFINITION HREF="26_glo_f.htm#float"><I>float</I></A> <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A>. The imaginary part can be a <A REL=DEFINITION HREF="26_glo_f.htm#float"><I>float</I></A> zero, but can never be a <A REL=DEFINITION HREF="26_glo_r.htm#rational"><I>rational</I></A> zero, for such a number is always represented by Common Lisp as a <A REL=DEFINITION HREF="26_glo_r.htm#rational"><I>rational</I></A> rather than a <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complex</I></A>. <P>
<P><B>Compound Type Specifier Kind:</B><P>
<P>
Specializing. <P>
<P><B>Compound Type Specifier Syntax:</B><P>
<P>
<B>complex</B> <I>[typespec | <A REL=DEFINITION HREF="a_st.htm#ST"><B>*</B></A>]</I><P>
<P>
<P><B>Compound Type Specifier Arguments:</B><P>
<P>
<I>typespec</I>---a <A REL=DEFINITION HREF="26_glo_t.htm#type_specifier"><I>type specifier</I></A> that denotes a <A REL=DEFINITION HREF="26_glo_s.htm#subtype"><I>subtype</I></A> of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="t_real.htm#real"><B>real</B></A>. <P>
<P><B>Compound Type Specifier Description:</B><P>
<P>
<P>
Every element of this <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> is a <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complex</I></A> whose real part and imaginary part are each of type <TT>(upgraded-complex-part-type </TT><I>typespec</I><TT>)</TT>. This <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> encompasses those <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complexes</I></A> that can result by giving numbers of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <I>typespec</I> to <A REL=DEFINITION HREF="f_comp_2.htm#complex"><B>complex</B></A>. <P>
<TT>(complex </TT><I>type-specifier</I><TT>)</TT> refers to all <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complexes</I></A> that can result from giving <A REL=DEFINITION HREF="26_glo_n.htm#number"><I>numbers</I></A> of <I>type</I> <I>type-specifier</I> to the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_comp_2.htm#complex"><B>complex</B></A>, plus all other <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complexes</I></A> of the same specialized representation. <P>
<P>
<P><B>See Also:</B><P>
<P>
<A REL=CHILD HREF="12_aec.htm">Section 12.1.5.3 (Rule of Canonical Representation for Complex Rationals)</A>, <A REL=CHILD HREF="02_cb.htm">Section 2.3.2 (Constructing Numbers from Tokens)</A>, <A REL=CHILD HREF="22_acad.htm">Section 22.1.3.1.4 (Printing Complexes)</A> <P>
<P><B>Notes:</B><P>
<P>
The input syntax for a <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complex</I></A> with real part r and imaginary part i is <TT>#C(r i)</TT>. For further details, see <A REL=CHILD HREF="02_d.htm">Section 2.4 (Standard Macro Characters)</A>. <P>
For every <A REL=DEFINITION HREF="26_glo_f.htm#float"><I>float</I></A>, n, there is a <A REL=DEFINITION HREF="26_glo_c.htm#complex"><I>complex</I></A> which represents the same mathematical number and which can be obtained by <TT>(COERCE n 'COMPLEX)</TT>. <P>
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issue</A>, <I>not part of the specification</I>, applies to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss015.htm">ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS:UNIFY-UPGRADING</A><P></UL><HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>