248 lines
No EOL
4.8 KiB
HTML
248 lines
No EOL
4.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<HTML LANG="en-us"
|
|
><HEAD
|
|
><TITLE
|
|
>+ | Common Lisp Nova Spec</TITLE
|
|
><META CHARSET="US-ASCII"
|
|
><LINK REL="canonical" HREF="f__plus.html"
|
|
><LINK REL="next" HREF="f__minus.html" TYPE="text/html" TITLE="−"
|
|
><LINK REL="prev" HREF="f__star.html" TYPE="text/html" TITLE="*"
|
|
><LINK REL="up" HREF="12_2_Numbers_Dictionary.html" TYPE="text/html" TITLE="12.2 Numbers Dictionary"
|
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
|
></SCRIPT
|
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
|
></SCRIPT
|
|
></HEAD
|
|
><BODY
|
|
><DIV
|
|
><DIV CLASS="topnav"
|
|
><DIV CLASS="breadcrumb"
|
|
><SPAN CLASS="breadcrumb-item"
|
|
><A HREF="index.html"
|
|
>Common Lisp Nova Spec</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="12_Numbers.html"
|
|
>12. Numbers</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="12_2_Numbers_Dictionary.html"
|
|
>12.2 Numbers Dictionary</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="f__plus.html"
|
|
>+</A
|
|
></SPAN
|
|
></DIV
|
|
><DIV CLASS="apropos"
|
|
><DIV CLASS="apropos-io"
|
|
><A HREF="f__star.html" CLASS="prev"
|
|
>←</A
|
|
><SPAN ID="apropos-label"
|
|
>Apropos </SPAN
|
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
|
><A HREF="f__minus.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV ID="apropos-res"
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="matter"
|
|
><DIV CLASS="com"
|
|
><DIV CLASS="begincom"
|
|
><HR
|
|
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
|
|
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="+"
|
|
></SPAN
|
|
><B
|
|
>+</B
|
|
></TD
|
|
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
|
|
><I
|
|
>Function</I
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
></DIV
|
|
><UL CLASS="subtoc"
|
|
></UL
|
|
><DL
|
|
><DT
|
|
><B
|
|
>Syntax</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><B
|
|
>+</B
|
|
> <SPAN CLASS="cmtt"
|
|
>&rest</SPAN
|
|
> <SPAN CLASS="cmssi"
|
|
>numbers</SPAN
|
|
> <SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
> <SPAN CLASS="cmssi"
|
|
>sum</SPAN
|
|
></P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Arguments and Values</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>number</VAR
|
|
> — a <A HREF="26_1_Glossary.html#number"
|
|
><EM CLASS="term"
|
|
>number</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>sum</VAR
|
|
> — a <A HREF="26_1_Glossary.html#number"
|
|
><EM CLASS="term"
|
|
>number</EM
|
|
></A
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Description</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>Returns the sum of <VAR CLASS="param"
|
|
>numbers</VAR
|
|
>, performing any necessary type conversions in the process. If no <VAR CLASS="param"
|
|
>numbers</VAR
|
|
> are supplied, <CODE CLASS="f"
|
|
>0</CODE
|
|
> is returned.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Examples</B
|
|
></DT
|
|
><DD
|
|
><PRE CLASS="screen"
|
|
>(+) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> 0
|
|
(+ 1) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> 1
|
|
(+ 31/100 69/100) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> 1
|
|
(+ 1/5 0.8) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> 1.0</PRE
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Exceptional Situations</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>Might signal <A HREF="t_type-error.html" CLASS="typeref"
|
|
><B
|
|
>type-error</B
|
|
></A
|
|
> if some <A HREF="26_1_Glossary.html#argument"
|
|
><EM CLASS="term"
|
|
>argument</EM
|
|
></A
|
|
> is not a <A HREF="26_1_Glossary.html#number"
|
|
><EM CLASS="term"
|
|
>number</EM
|
|
></A
|
|
>. Might signal <A HREF="t_arithmetic-error.html" CLASS="typeref"
|
|
><B
|
|
>arithmetic-error</B
|
|
></A
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>See Also</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><A HREF="12_1_Number_Concepts.html#sec_12_1_1" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>12.1.1</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Numeric</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Operations)</SPAN
|
|
></A
|
|
>, <A HREF="12_1_Number_Concepts.html#sec_12_1_3" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>12.1.3</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Rational</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Computations)</SPAN
|
|
></A
|
|
>, <A HREF="12_1_Number_Concepts.html#sec_12_1_4" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>12.1.4</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Floating-point</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Computations)</SPAN
|
|
></A
|
|
>, <A HREF="12_1_Number_Concepts.html#sec_12_1_5" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>12.1.5</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Complex</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Computations)</SPAN
|
|
></A
|
|
></P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="footer"
|
|
><DIV CLASS="btmnav"
|
|
><A HREF="f__star.html" CLASS="prev"
|
|
>←</A
|
|
><A HREF="f__minus.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV CLASS="trail"
|
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
|
></DIV
|
|
></DIV
|
|
><SCRIPT
|
|
>domReady();</SCRIPT
|
|
></BODY
|
|
></HTML
|
|
> |