828 lines
86 KiB
HTML
828 lines
86 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Numbers (ECL Manual)</title>
|
|
|
|
<meta name="description" content="Numbers (ECL Manual)">
|
|
<meta name="keywords" content="Numbers (ECL Manual)">
|
|
<meta name="resource-type" content="document">
|
|
<meta name="distribution" content="global">
|
|
<meta name="Generator" content="makeinfo">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<link href="index.html" rel="start" title="Top">
|
|
<link href="Indexes.html" rel="index" title="Indexes">
|
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
|
<link href="Standards.html" rel="up" title="Standards">
|
|
<link href="Characters.html#Characters" rel="next" title="Characters">
|
|
<link href="Packages.html" rel="prev" title="Packages">
|
|
<style type="text/css">
|
|
<!--
|
|
/* colors */
|
|
|
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
|
span.r {font-family: initial; font-weight: normal; font-style: normal}
|
|
span:hover a.copiable-link {visibility: visible}
|
|
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
|
|
ul.mark-bullet {list-style-type: disc}
|
|
@media (prefers-color-scheme: dark) {
|
|
/* dark theme */
|
|
html { color: seashell;
|
|
background: #1A1A1A; }
|
|
body { background: #1A1A1A; }
|
|
th { border-bottom: 2px solid lightgray; }
|
|
h1, h2, h3, h4, h5 { background-image: linear-gradient(to left, #202020, #3A3A3A); }
|
|
code, var, code a { color: darkorange;
|
|
background: #2A2A2A; }
|
|
a { color: seashell; }
|
|
pre { background: #2A2A2A;
|
|
color: seashell;
|
|
/* mark longer code block with stripe on the left */
|
|
border-left: 5px solid darkorange;
|
|
padding-left: 10px; }
|
|
pre.screen { background: #2A2A2A;
|
|
border: 1px solid lightgray; }
|
|
pre.programlisting { background: #2A2A2A;
|
|
border-left: 1px solid lightgray;
|
|
border-top: 1px solid lightgray; }
|
|
/* we need a light background in order for the images to be readable */
|
|
img { background: white }
|
|
}
|
|
@media (prefers-color-scheme: light) {
|
|
/* light theme */
|
|
html { background: white }
|
|
body { background: white }
|
|
th { border-bottom: 2px solid gray; }
|
|
h1, h2, h3, h4, h5 { background: lightgray; }
|
|
code, var, code a { color: darkred;
|
|
background: whitesmoke; }
|
|
a { color: #000; }
|
|
pre { background: whitesmoke;
|
|
color: black;
|
|
/* mark longer code block with stripe on the left */
|
|
border-left: 5px solid darkred;
|
|
padding-left: 10px; }
|
|
pre.screen { background: #EEE;
|
|
border: 1px solid black; }
|
|
pre.programlisting { background: #EEEEEE;
|
|
border-left: 1px solid black;
|
|
border-top: 1px solid black; }
|
|
}
|
|
|
|
body {
|
|
margin: 1em 125px 0 10%;
|
|
line-height: 1.5em;
|
|
padding: 0 2em 1em 2em;
|
|
font: 13px Verdana,Arial, sans-serif
|
|
}
|
|
ul, dd, dl, dt { margin-top: 0; margin-bottom: 0; }
|
|
p, code, td, dl, dt {
|
|
line-height: 1.5em;
|
|
}
|
|
table {
|
|
font: inherit;
|
|
border-collapse: collapse;
|
|
}
|
|
th, td {
|
|
vertical-align: top;
|
|
}
|
|
h1, h2, h3 { padding-left: 15px; }
|
|
h4, h5 { padding-left: 5px; }
|
|
code, pre {
|
|
font-size: 1em;
|
|
font-family: monospace;
|
|
}
|
|
var {
|
|
font-size: 1em;
|
|
}
|
|
/* links inside code appear the same as the code itself */
|
|
code a {
|
|
font-weight: normal;
|
|
text-decoration: none;
|
|
}
|
|
/* but get an underline when hovering */
|
|
code a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
/* ordinary links appear in bold */
|
|
a { font-weight: bold; }
|
|
pre.verbatim {
|
|
margin: 0 0 0 0;
|
|
}
|
|
pre {
|
|
overflow: auto;
|
|
}
|
|
pre.screen {
|
|
font-weight: bold;
|
|
padding: 0.5em;
|
|
}
|
|
pre.programlisting {
|
|
padding: 0.5em;
|
|
}
|
|
div p { padding: 0 2em }
|
|
li p { padding: 0; margin: 0 }
|
|
hr { display: none; }
|
|
div.funcsynopsis p {
|
|
text-indent: -2em;
|
|
}
|
|
div.variablelist {
|
|
padding: 0 2em;
|
|
}
|
|
.type, .funcsynopsis, .symbol {
|
|
font-family: monospace;
|
|
}
|
|
.type, .symbol, .replaceable {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
-->
|
|
</style>
|
|
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
|
<div class="section-level-extent" id="Numbers">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Characters.html#Characters" accesskey="n" rel="next">Characters</a>, Previous: <a href="Packages.html" accesskey="p" rel="prev">Packages</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h3 class="section" id="Numbers-1">2.10 Numbers</h3>
|
|
|
|
|
|
<ul class="mini-toc">
|
|
<li><a href="Numbers.html#Numbers-_002d-Numeric-types" accesskey="1">Numeric types</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Floating-point-exceptions" accesskey="2">Floating point exceptions</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Random_002dStates" accesskey="3">Random-States</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Infinity-and-Not-a-Number" accesskey="4">Infinity and Not a Number</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Branch-cuts-and-signed-zero" accesskey="5">Branch cuts and signed zero</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Dictionary" accesskey="6">Dictionary</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="7">C Reference</a></li>
|
|
</ul>
|
|
<hr>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Numeric-types">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Floating-point-exceptions" accesskey="n" rel="next">Floating point exceptions</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Numeric-types">2.10.1 Numeric types</h4>
|
|
<p>ECL supports all of the Common Lisp numeric tower, which is shown in <a class="ref" href="Numbers.html#tab_003anum_002dtypes">Table 2.5</a>. The details, however, depend both on the platform on which ECL runs and on the configuration which was chosen when building ECL.
|
|
</p>
|
|
<div class="float" id="tab_003anum_002dtypes">
|
|
|
|
<table class="multitable">
|
|
<thead><tr><th width="18%">Type</th><th width="82%">Description</th></tr></thead>
|
|
<tbody><tr><td width="18%">fixnum</td><td width="82%">Signed integer with a number of bits given by ext:fixnum-bits, fit in a machine word.</td></tr>
|
|
<tr><td width="18%">bignum</td><td width="82%">Arbitrary size integers, only limited by amount of memory.</td></tr>
|
|
<tr><td width="18%">ratio</td><td width="82%">Arbitrary size rational number, made up of two integers.</td></tr>
|
|
<tr><td width="18%">short-float</td><td width="82%">Equivalent to single-float.</td></tr>
|
|
<tr><td width="18%">single-float</td><td width="82%">32-bits IEEE floating point number.</td></tr>
|
|
<tr><td width="18%">double-float</td><td width="82%">64-bits IEEE floating point number.</td></tr>
|
|
<tr><td width="18%">long-float</td><td width="82%">Either equivalent to double-float, or a 96/128 bits IEEE floating point number (long double in C/C++).</td></tr>
|
|
<tr><td width="18%">rational</td><td width="82%">An alias for (or integer ratio)</td></tr>
|
|
<tr><td width="18%">float</td><td width="82%">An alias for (or single-float double-float short-float long-float)</td></tr>
|
|
<tr><td width="18%">real</td><td width="82%">An alias for (or rational float)</td></tr>
|
|
<tr><td width="18%">complex</td><td width="82%">Complex number made of two real numbers of the above mentioned types or a <float> _Complex type in C99.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="caption"><p><strong class="strong">Table 2.5: </strong>Numeric types in ECL</p></div></div>
|
|
<p>In general, the size of a <code class="code">fixnum</code> is determined by the word size
|
|
of a machine, which ranges from 32 to 64 bits. Integers larger than
|
|
this are implemented using the <a class="url" href="https://gmplib.org/">GNU
|
|
Multiprecision library</a>. Rationals are implemented using two integers,
|
|
without caring whether they are fixnum or not. Floating point numbers
|
|
include at least the two IEEE types of 32 and 64 bits respectively.
|
|
</p>
|
|
<a class="index-entry-id" id="index-long_002dfloat-internal-representation"></a>
|
|
<a class="index-entry-id" id="index-LONG_002dFLOAT"></a>
|
|
<p>In machines where it is supported, it is possible to associate the
|
|
lisp <code class="code">long-float</code> with the machine type <code class="code">long double</code> whose
|
|
size ranges from 96 to 128 bits, and which are a bit slower.
|
|
</p>
|
|
<a class="index-entry-id" id="index-_0028complex-float_0029-internal-representation"></a>
|
|
<a class="index-entry-id" id="index-COMPLEX_002dFLOAT"></a>
|
|
<p>In machines where a type <code class="code"><float> _Complex</code> is supported numbers
|
|
of type <code class="code">(complex float)</code> are implemented with it, otherwise like
|
|
ratios all complex numbers are pairs of numbers.
|
|
</p>
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Floating-point-exceptions">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Random_002dStates" accesskey="n" rel="next">Random-States</a>, Previous: <a href="Numbers.html#Numbers-_002d-Numeric-types" accesskey="p" rel="prev">Numeric types</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Floating-point-exceptions">2.10.2 Floating point exceptions</h4>
|
|
<a class="index-entry-id" id="index-_002d_002dwith_002dieee_002dfp-_005bYES_007cno_005d"></a>
|
|
<a class="index-entry-id" id="index-_002d_002dwith_002dfpe-_005bYES_007cno_005d"></a>
|
|
|
|
<p>ECL supports two ways of dealing with special floating point values,
|
|
such as Not a Number (NaN), infinity or denormalized floats, which can
|
|
occur in floating point computations. Either a condition is signaled or
|
|
the value is silently used as it is. There are multiple options
|
|
controlling which behaviour is selected: If ECL is built with the
|
|
<code class="code">--without-ieee-fp</code> configure option, then a condition is signaled
|
|
for every infinity or NaN encountered. If not, floating point exceptions
|
|
can be disabled at build time using the <code class="code">--without-fpe</code> configure
|
|
option. Otherwise, if both <code class="code">--with-ieee-fp</code> and <code class="code">--with-fpe</code>
|
|
options are on, by default, a condition is signaled for invalid
|
|
operation, division by zero and floating point overflows. This can be
|
|
changed at runtime by using <code class="code"><a class="ref" href="Numbers.html#ext_003atrap_002dfpe">ext:trap-fpe</a></code>. If the
|
|
<code class="code">ECL_OPT_TRAP_SIGFPE</code> boot option is false (see
|
|
<a class="ref" href="Embedding-ECL.html#tab_003aboot_002doptions">Table 1.1</a>), no conditions are signaled by default (Note
|
|
that in this case, if you enable trapping of floating point exceptions
|
|
with <code class="code"><a class="ref" href="Numbers.html#ext_003atrap_002dfpe">ext:trap-fpe</a></code>, then you have to install your own signal
|
|
handler).
|
|
</p>
|
|
<a class="anchor" id="ext_003atrap_002dfpe"></a><a class="index-entry-id" id="index-ext_003atrap_002dfpe-1"></a>
|
|
<dl class="first-deffn first-defun-alias-first-deffn">
|
|
<dt class="deffn defun-alias-deffn" id="index-ext_003atrap_002dfpe"><span class="category-def">Function: </span><span><strong class="def-name">ext:trap-fpe</strong> <var class="def-var-arguments">condition flag</var><a class="copiable-link" href='Numbers.html#index-ext_003atrap_002dfpe'> ¶</a></span></dt>
|
|
<dd><p>Control the signaling of the floating point exceptions
|
|
</p>
|
|
|
|
<p><b class="b">Synopsis</b>
|
|
</p>
|
|
<dl class="table">
|
|
<dt><var class="var">condition</var></dt>
|
|
<dd><p>a symbol - one of <code class="code">cl:last</code>, <code class="code">cl:t</code>, <code class="code">cl:division-by-zero</code>,
|
|
<code class="code">cl:floating-point-overflow</code>, <code class="code">cl:floating-point-underflow</code>,
|
|
<code class="code">cl:floating-point-invalid-operation</code>,
|
|
<code class="code">cl:floating-point-inexact</code> or an integer.
|
|
</p></dd>
|
|
<dt><var class="var">flag</var></dt>
|
|
<dd><p>a generalized boolean
|
|
</p></dd>
|
|
</dl>
|
|
|
|
|
|
<p><b class="b">Description</b>
|
|
</p>
|
|
<p>If <var class="var">condition</var> is <code class="code">last</code>, <var class="var">flag</var> is ignored and the
|
|
currently enabled floating point exceptions are returned in an
|
|
implementation depended format (currently an integer). Otherwise,
|
|
<var class="var">flag</var> determines whether the current thread will signal a floating
|
|
point exception for the conditions passed in <var class="var">condition</var>.
|
|
<var class="var">condition</var> can be either a symbol denoting a single condition,
|
|
<code class="code">t</code> for all conditions that are enabled by default or a value
|
|
obtained from an earlier call to <code class="code"><a class="ref" href="Numbers.html#ext_003atrap_002dfpe">ext:trap-fpe</a></code> with
|
|
<code class="code">last</code>.
|
|
</p>
|
|
|
|
<p><b class="b">See also</b>
|
|
</p>
|
|
<p><code class="code"><a class="ref" href="Embedding-ECL.html#ECL_005fWITH_005fLISP_005fFPE">ECL_WITH_LISP_FPE</a></code>
|
|
</p>
|
|
</dd></dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Random_002dStates">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Infinity-and-Not-a-Number" accesskey="n" rel="next">Infinity and Not a Number</a>, Previous: <a href="Numbers.html#Numbers-_002d-Floating-point-exceptions" accesskey="p" rel="prev">Floating point exceptions</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Random_002dStates">2.10.3 Random-States</h4>
|
|
<p>ECL relies internally on a 32-bit Mersenne-Twister random number
|
|
generator, using a relatively large buffer to precompute about 5000
|
|
pseudo-random bytes. This implies also that random states can be
|
|
printed readably and also read, using the <code class="code">#$</code> macro. There is no
|
|
provision to create random states from user arrays, though. Random
|
|
state is printed unreadably by default.
|
|
</p>
|
|
<p>The <code class="code">#$</code> macro can be used to initialize the generator with a
|
|
random seed (an integer), an array of random bytes (mainly used for
|
|
reading back printed random-state) and another random-state (syntactic
|
|
sugar for copying the random-state).
|
|
</p>
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Infinity-and-Not-a-Number">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Branch-cuts-and-signed-zero" accesskey="n" rel="next">Branch cuts and signed zero</a>, Previous: <a href="Numbers.html#Numbers-_002d-Random_002dStates" accesskey="p" rel="prev">Random-States</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Infinity-and-Not-a-Number">2.10.4 Infinity and Not a Number</h4>
|
|
<p>The <span class="r">ANSI Common-Lisp</span> standard does not specify the behaviour of numeric
|
|
functions for infinite or not number valued floating point numbers. If
|
|
ECL is configured to support these special values (see the
|
|
<code class="code">--with-ieee-fp</code> configure option) and floating point exceptions
|
|
are disabled, numeric functions generally return the same value as the
|
|
corresponding C function. This means, that the output will be a NaN
|
|
for a NaN input, and the “mathematically correct” value (which may
|
|
be NaN, e.g. for ∞-∞) for an infinite real input. For complex floats,
|
|
however, the return value of a numeric function called with a complex
|
|
number for which the real or imaginary part is infinite, is
|
|
undefined<a class="footnote" id="DOCF1" href="Numbers.html#FOOT1"><sup>1</sup></a>.
|
|
</p>
|
|
<p>For other functions dealing with numbers, we adopt the following
|
|
behaviour:
|
|
</p>
|
|
<dl class="table">
|
|
<dt>Comparison functions</dt>
|
|
<dd><p>All numeric comparisons with <code class="code">=,<,<=,>,>=</code> involving NaN return
|
|
false. Comparing two NaNs of the same type with <code class="code">eql</code> returns
|
|
true.
|
|
</p></dd>
|
|
<dt><code class="code">min/max</code></dt>
|
|
<dd><p>NaN values are ignored, i.e. the maximum/minimum is taken only over
|
|
the number valued parameters.
|
|
</p></dd>
|
|
<dt>Rounding functions</dt>
|
|
<dd><p>All rounding functions signal an <code class="code">arithmetic-error</code> if any of the
|
|
given parameters are not number valued or infinite.
|
|
</p></dd>
|
|
</dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Branch-cuts-and-signed-zero">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Dictionary" accesskey="n" rel="next">Dictionary</a>, Previous: <a href="Numbers.html#Numbers-_002d-Infinity-and-Not-a-Number" accesskey="p" rel="prev">Infinity and Not a Number</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Branch-cuts-and-signed-zero">2.10.5 Branch cuts and signed zero</h4>
|
|
<p>For multi-valued complex functions like <code class="code">asin</code>, <code class="code">acos</code>, etc.
|
|
the <span class="r">ANSI Common-Lisp</span> standard specifies in detail the location of the branch cuts
|
|
and in particular the value of these functions on the branch cuts. ECL
|
|
diverges from the standard in that the sign of zero distinguishes two
|
|
sides of a branch cut. For example, the <code class="code">asin</code> function includes a
|
|
branch cut running from 1 to ∞ on the real axis. The ANSI standard
|
|
specifies a negative imaginary part for <code class="code">asin</code> on this branch cut
|
|
consistent with approaching the cut from below. Evaluating <code class="code">(asin
|
|
z)</code> in ECL, on the other hand, returns a result with positive imaginary
|
|
part if the imaginary part of <code class="code">z</code> is <code class="code">+0.0</code> (consistent with
|
|
approaching the cut from above) and a result with negative imaginary
|
|
part if the imaginary part of <code class="code">z</code> is <code class="code">-0.0</code> (consistent with
|
|
approaching the cut from below)<a class="footnote" id="DOCF2" href="Numbers.html#FOOT2"><sup>2</sup></a>. This applies to <code class="code">sqrt</code>, <code class="code">asin</code>,
|
|
<code class="code">acos</code>, <code class="code">atan</code>, <code class="code">asinh</code>, <code class="code">acosh</code> and <code class="code">atanh</code>.
|
|
</p>
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-Dictionary">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="n" rel="next">C Reference</a>, Previous: <a href="Numbers.html#Numbers-_002d-Branch-cuts-and-signed-zero" accesskey="p" rel="prev">Branch cuts and signed zero</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="Dictionary">2.10.6 Dictionary</h4>
|
|
|
|
<a class="anchor" id="ext_003ashort_002dfloat_002dpositive_002dinfinity"></a><a class="index-entry-id" id="index-ext_003ashort_002dfloat_002dpositive_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003ashort_002dfloat_002dnegative_002dinfinity"></a><a class="index-entry-id" id="index-ext_003ashort_002dfloat_002dnegative_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003asingle_002dfloat_002dpositive_002dinfinity"></a><a class="index-entry-id" id="index-ext_003asingle_002dfloat_002dpositive_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003asingle_002dfloat_002dnegative_002dinfinity"></a><a class="index-entry-id" id="index-ext_003asingle_002dfloat_002dnegative_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003adouble_002dfloat_002dpositive_002dinfinity"></a><a class="index-entry-id" id="index-ext_003adouble_002dfloat_002dpositive_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003adouble_002dfloat_002dnegative_002dinfinity"></a><a class="index-entry-id" id="index-ext_003adouble_002dfloat_002dnegative_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003along_002dfloat_002dpositive_002dinfinity"></a><a class="index-entry-id" id="index-ext_003along_002dfloat_002dpositive_002dinfinity"></a>
|
|
<a class="anchor" id="ext_003along_002dfloat_002dnegative_002dinfinity"></a><a class="index-entry-id" id="index-ext_003along_002dfloat_002dnegative_002dinfinity"></a>
|
|
<dl class="first-defvr">
|
|
<dt class="defvr" id="index-ext_003a_007bshort_002csingle_002cdouble_002clong_007d_002dfloat_002d_007bpositive_002cnegative_007d_002dinfinity"><span class="category-def">Constant: </span><span><strong class="def-name">ext:{short,single,double,long}-float-{positive,negative}-infinity</strong><a class="copiable-link" href='Numbers.html#index-ext_003a_007bshort_002csingle_002cdouble_002clong_007d_002dfloat_002d_007bpositive_002cnegative_007d_002dinfinity'> ¶</a></span></dt>
|
|
<dd><p>Constant positive/negative infinity for the different floating point types.
|
|
</p></dd></dl>
|
|
|
|
|
|
<a class="anchor" id="ext_003anan"></a><a class="index-entry-id" id="index-ext_003anan-1"></a>
|
|
<dl class="first-deffn first-defun-alias-first-deffn">
|
|
<dt class="deffn defun-alias-deffn" id="index-ext_003anan"><span class="category-def">Function: </span><span><strong class="def-name">ext:nan</strong><a class="copiable-link" href='Numbers.html#index-ext_003anan'> ¶</a></span></dt>
|
|
<dd><p>Returns a double float NaN value. Coerce to other floating point types
|
|
to get NaN values e.g. for single floats.
|
|
</p></dd></dl>
|
|
|
|
<a class="anchor" id="ext_003afloat_002dinfinity_002dp"></a><a class="index-entry-id" id="index-ext_003afloat_002dinfinity_002dp-1"></a>
|
|
<a class="index-entry-id" id="index-ext_003afloat_002dnan_002dp-1"></a>
|
|
<dl class="first-deffn first-defun-alias-first-deffn">
|
|
<dt class="deffn defun-alias-deffn" id="index-ext_003afloat_002dinfinity_002dp"><span class="category-def">Function: </span><span><strong class="def-name">ext:float-infinity-p</strong> <var class="def-var-arguments">x</var><a class="copiable-link" href='Numbers.html#index-ext_003afloat_002dinfinity_002dp'> ¶</a></span></dt>
|
|
<dt class="deffnx defunx-alias-deffnx def-cmd-deffn" id="index-ext_003afloat_002dnan_002dp"><span class="category-def">Function: </span><span><strong class="def-name">ext:float-nan-p</strong> <var class="def-var-arguments">x</var><a class="copiable-link" href='Numbers.html#index-ext_003afloat_002dnan_002dp'> ¶</a></span></dt>
|
|
<dd><p>Predicates to test if <var class="var">x</var> is infinite or NaN.
|
|
</p></dd></dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsection-level-extent" id="Numbers-_002d-C-Reference">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Previous: <a href="Numbers.html#Numbers-_002d-Dictionary" accesskey="p" rel="prev">Dictionary</a>, Up: <a href="Numbers.html#Numbers" accesskey="u" rel="up">Numbers</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsection" id="C-Reference-10">2.10.7 C Reference</h4>
|
|
|
|
|
|
<ul class="mini-toc">
|
|
<li><a href="Numbers.html#Numbers-_002d-Number-C-types" accesskey="1">Number C types</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Number-constructors" accesskey="2">Number constructors</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Number-accessors" accesskey="3">Number accessors</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-Number-coercion" accesskey="4">Number coercion</a></li>
|
|
<li><a href="Numbers.html#Numbers-_002d-ANSI-dictionary" accesskey="5">ANSI dictionary</a></li>
|
|
</ul>
|
|
<hr>
|
|
<div class="subsubsection-level-extent" id="Numbers-_002d-Number-C-types">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Number-constructors" accesskey="n" rel="next">Number constructors</a>, Up: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="u" rel="up">C Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsubsection" id="Number-C-types">2.10.7.1 Number C types</h4>
|
|
<p>Numeric C types understood by ECL
|
|
</p>
|
|
<h4 class="subsubheading" id="Type-names">Type names</h4>
|
|
<table class="multitable">
|
|
<tbody><tr><td width="21%">cl_fixnum</td><td width="40%">fixnum</td></tr>
|
|
<tr><td width="21%">cl_index</td><td width="40%">(integer 0 most-positive-fixnum)</td></tr>
|
|
<tr><td width="21%">float</td><td width="40%">short-float, single-float</td></tr>
|
|
<tr><td width="21%">double</td><td width="40%">double-float</td></tr>
|
|
<tr><td width="21%">long double (*)</td><td width="40%">long-float</td><td width="25%">ECL_LONG_FLOAT</td><td width="14%">:long-float</td></tr>
|
|
<tr><td width="21%">float _Complex (**)</td><td width="40%">(complex single-float)</td><td width="25%">ECL_COMPLEX_FLOAT</td><td width="14%">:complex-float</td></tr>
|
|
<tr><td width="21%">double _Complex (**)</td><td width="40%">(complex double-float)</td><td width="25%">ECL_COMPLEX_FLOAT</td><td width="14%">:complex-float</td></tr>
|
|
<tr><td width="21%">long-double _Complex (**)</td><td width="40%">(complex long-float)</td><td width="25%">ECL_COMPLEX_FLOAT</td><td width="14%">:complex-float</td></tr>
|
|
<tr><td width="21%">uint8_t</td><td width="40%">(unsigned-byte 8)</td><td width="25%">ecl_uint8_t</td></tr>
|
|
<tr><td width="21%">int8_t</td><td width="40%">(signed-byte 8)</td><td width="25%">ecl_int8_t</td></tr>
|
|
<tr><td width="21%">uint16_t</td><td width="40%">(unsigned-byte 16)</td><td width="25%">ecl_uint16_t</td><td width="14%">:uint16-t</td></tr>
|
|
<tr><td width="21%">int16_t</td><td width="40%">(signed-byte 16)</td><td width="25%">ecl_int16_t</td><td width="14%">:int16-t</td></tr>
|
|
<tr><td width="21%">uint32_t</td><td width="40%">(unsigned-byte 32)</td><td width="25%">ecl_uint32_t</td><td width="14%">:uint32-t</td></tr>
|
|
<tr><td width="21%">int32_t</td><td width="40%">(signed-byte 32)</td><td width="25%">ecl_int32_t</td><td width="14%">:int32-t</td></tr>
|
|
<tr><td width="21%">uint64_t</td><td width="40%">(unsigned-byte 64)</td><td width="25%">ecl_uint64_t</td><td width="14%">:uint64-t</td></tr>
|
|
<tr><td width="21%">int64_t</td><td width="40%">(signed-byte 64)</td><td width="25%">ecl_int64_t</td><td width="14%">:int64-t</td></tr>
|
|
<tr><td width="21%">short</td><td width="40%">(integer ffi:c-short-min ffi:c-short-max)</td></tr>
|
|
<tr><td width="21%">unsigned short</td><td width="40%">(integer 0 ffi:c-ushort-max)</td></tr>
|
|
<tr><td width="21%">int</td><td width="40%">(integer ffi:c-int-min ffi:c-int-max)</td></tr>
|
|
<tr><td width="21%">unsigned int</td><td width="40%">(integer 0 ffi:c-uint-max)</td></tr>
|
|
<tr><td width="21%">long</td><td width="40%">(integer ffi:c-long-min ffi:c-long-max)</td></tr>
|
|
<tr><td width="21%">unsigned long</td><td width="40%">(integer 0 ffi:c-long-max)</td></tr>
|
|
<tr><td width="21%">long long</td><td width="40%">(integer ffi:c-long-long-min ffi:c-long-long-max)</td><td width="25%">ecl_long_long_t</td><td width="14%">:long-long</td></tr>
|
|
<tr><td width="21%">unsigned long long</td><td width="40%">(integer 0 ffi:c-ulong-long-max)</td><td width="25%">ecl_ulong_long_t</td><td width="14%">:ulong-long</td></tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><b class="b">Description</b>
|
|
</p>
|
|
<p>The table above shows the relation between C types and the equivalent Common Lisp types. All types are standard C99 types, except for two. First, <code class="code">cl_fixnum</code> is the smallest signed integer that can fit a fixnum. Second, <code class="code">cl_index</code> is the smallest unsigned integer that fits a fixnum and is typically the unsigned counterpart of <code class="code">cl_fixnum</code>.
|
|
</p>
|
|
<p>(*) <strong class="strong">DEPRECATED</strong> Previous versions of ECL supported compilers
|
|
that did not define the long double type. The <code class="code">ECL_LONG_DOUBLE</code>
|
|
macro and <code class="code">long-double</code> features indicating whether support for
|
|
long double was available are removed now.
|
|
</p>
|
|
<a class="index-entry-id" id="index-_002d_002denable_002dc99complex-_005bauto_005d"></a>
|
|
<p>(**) The <float> _Complex types do not exist on all platforms. When
|
|
they exist the macro <code class="code">ECL_COMPLEX_FLOAT</code> will be defined.
|
|
</p>
|
|
<p>Many other types might also not exist on all platforms. This includes
|
|
not only <code class="code">long long</code> and <code class="code">unsigned long long</code>, but also some
|
|
of the C99 integer types. There are two ways to detect which integer
|
|
types are available in your system:
|
|
</p>
|
|
<ul class="itemize mark-bullet">
|
|
<li>Check for the definition of C macros with a similar name, shown in the fifth column above.
|
|
</li><li>In Lisp code, check for the presence of the associated features, shown in the fourth column above.
|
|
</li></ul>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsubsection-level-extent" id="Numbers-_002d-Number-constructors">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Number-accessors" accesskey="n" rel="next">Number accessors</a>, Previous: <a href="Numbers.html#Numbers-_002d-Number-C-types" accesskey="p" rel="prev">Number C types</a>, Up: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="u" rel="up">C Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsubsection" id="Number-constructors">2.10.7.2 Number constructors</h4>
|
|
<p>Creating Lisp types from C numbers
|
|
</p>
|
|
<h4 class="subsubheading" id="Functions">Functions</h4>
|
|
<a class="anchor" id="ecl_005fmake_005ffixnum"></a><a class="index-entry-id" id="index-ecl_005fmake_005ffixnum"></a>
|
|
<a class="anchor" id="ecl_005fmake_005finteger"></a><a class="index-entry-id" id="index-ecl_005fmake_005finteger"></a>
|
|
<a class="anchor" id="ecl_005fmake_005funsigned_005finteger"></a><a class="index-entry-id" id="index-ecl_005fmake_005funsigned_005finteger"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fsingle_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005fsingle_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fdouble_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005fdouble_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005flong_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005flong_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fcsfloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005fcsfloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fcdfloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005fcdfloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fclfloat"></a><a class="index-entry-id" id="index-ecl_005fmake_005fclfloat"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fuint8_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fuint8_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fint8_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fint8_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fuint16_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fuint16_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fint16_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fint16_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fuint32_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fuint32_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fint32_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fint32_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fuint64_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fuint64_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fint64_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fint64_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fshort_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fshort_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fushort_005ft"></a><a class="index-entry-id" id="index-ecl_005fmake_005fushort_005ft"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fint"></a><a class="index-entry-id" id="index-ecl_005fmake_005fint"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fuint"></a><a class="index-entry-id" id="index-ecl_005fmake_005fuint"></a>
|
|
<a class="anchor" id="ecl_005fmake_005flong"></a><a class="index-entry-id" id="index-ecl_005fmake_005flong"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fulong"></a><a class="index-entry-id" id="index-ecl_005fmake_005fulong"></a>
|
|
<a class="anchor" id="ecl_005fmake_005flong_005flong"></a><a class="index-entry-id" id="index-ecl_005fmake_005flong_005flong"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fulong_005flong"></a><a class="index-entry-id" id="index-ecl_005fmake_005fulong_005flong"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fratio"></a><a class="index-entry-id" id="index-ecl_005fmake_005fratio"></a>
|
|
<a class="anchor" id="ecl_005fmake_005fcomplex"></a><a class="index-entry-id" id="index-ecl_005fmake_005fcomplex"></a>
|
|
|
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fmake_005ffixnum-2"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_fixnum</strong> <code class="def-code-arguments">(cl_fixnum n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005ffixnum-2'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005finteger-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_integer</strong> <code class="def-code-arguments">(cl_fixnum n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005finteger-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005funsigned_005finteger-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_unsigned_integer</strong> <code class="def-code-arguments">(cl_index n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005funsigned_005finteger-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fsingle_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_single_float</strong> <code class="def-code-arguments">(float n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fsingle_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fdouble_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_double_float</strong> <code class="def-code-arguments">(double n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fdouble_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005flong_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_long_float</strong> <code class="def-code-arguments">(long double n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005flong_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fcsfloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_csfloat</strong> <code class="def-code-arguments">(float _Complex n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fcsfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fcdfloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_cdfloat</strong> <code class="def-code-arguments">(double _Complex n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fcdfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fclfloat-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_clfloat</strong> <code class="def-code-arguments">(long double _Complex n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fclfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fuint8_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_uint8_t</strong> <code class="def-code-arguments">(uint8_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fuint8_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fint8_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_int8_t</strong> <code class="def-code-arguments">(int8_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fint8_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fuint16_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_uint16_t</strong> <code class="def-code-arguments">(uint16_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fuint16_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fint16_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_int16_t</strong> <code class="def-code-arguments">(int16_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fint16_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fuint32_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_uint32_t</strong> <code class="def-code-arguments">(uint32_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fuint32_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fint32_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_int32_t</strong> <code class="def-code-arguments">(int32_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fint32_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fuint64_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_uint64_t</strong> <code class="def-code-arguments">(uint64_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fuint64_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fint64_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_int64_t</strong> <code class="def-code-arguments">(int64_t n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fint64_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fshort_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_short_t</strong> <code class="def-code-arguments">(short n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fshort_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fushort_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_ushort_t</strong> <code class="def-code-arguments">(unsigned short n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fushort_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fint-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_int</strong> <code class="def-code-arguments">(int n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fint-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fuint-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_uint</strong> <code class="def-code-arguments">(unsigned int n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fuint-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_long</strong> <code class="def-code-arguments">(long n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005flong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fulong-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_ulong</strong> <code class="def-code-arguments">(unsigned long n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fulong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005flong_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_long_long</strong> <code class="def-code-arguments">(long long n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005flong_005flong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fulong_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_ulong_long</strong> <code class="def-code-arguments">(unsigned long long n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fulong_005flong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fratio-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_ratio</strong> <code class="def-code-arguments">(cl_object numerator, cl_object denominator)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fratio-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fcomplex-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_complex</strong> <code class="def-code-arguments">(cl_object real, cl_object imag)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fmake_005fcomplex-1'> ¶</a></span></dt>
|
|
<dd>
|
|
|
|
<p><b class="b">Description</b>
|
|
</p>
|
|
<p>These functions create a Lisp object from the corresponding C
|
|
number. If the number is an integer type, the result will always be an
|
|
integer, which may be a bignum. If on the other hand the C number is a
|
|
float, double or long double, the result will be a float.
|
|
</p>
|
|
<p>There is some redundancy in the list of functions that convert from
|
|
cl_fixnum and cl_index to lisp. On the one hand,
|
|
<code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005ffixnum">ecl_make_fixnum</a></code> always creates a fixnum, dropping bits if
|
|
necessary. On the other hand, <code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005finteger">ecl_make_integer</a></code> and
|
|
<code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005funsigned_005finteger">ecl_make_unsigned_integer</a></code> faithfully convert to a Lisp
|
|
integer, which may be a bignum.
|
|
</p>
|
|
<p>Note also that some of the constructors do not use C numbers. This is
|
|
the case of <code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005fratio">ecl_make_ratio</a></code> and <code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005fcomplex">ecl_make_complex</a></code>,
|
|
because they are composite Lisp types. When c99 complex float support is
|
|
built in <code class="code"><a class="ref" href="Numbers.html#ecl_005fmake_005fcomplex">ecl_make_complex</a></code> will use C number for float types.
|
|
</p>
|
|
<p>These functions or macros signal no errors.
|
|
</p></dd></dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsubsection-level-extent" id="Numbers-_002d-Number-accessors">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-Number-coercion" accesskey="n" rel="next">Number coercion</a>, Previous: <a href="Numbers.html#Numbers-_002d-Number-constructors" accesskey="p" rel="prev">Number constructors</a>, Up: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="u" rel="up">C Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsubsection" id="Number-accessors">2.10.7.3 Number accessors</h4>
|
|
<p>Unchecked conversion from Lisp types to C numbers
|
|
</p>
|
|
<h4 class="subsubheading" id="Functions-1">Functions</h4>
|
|
<a class="anchor" id="ecl_005ffixnum"></a><a class="index-entry-id" id="index-ecl_005ffixnum"></a>
|
|
<a class="anchor" id="ecl_005fsingle_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fsingle_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fdouble_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fdouble_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005flong_005ffloat"></a><a class="index-entry-id" id="index-ecl_005flong_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fcsfloat"></a><a class="index-entry-id" id="index-ecl_005fcsfloat"></a>
|
|
<a class="anchor" id="ecl_005fcdfloat"></a><a class="index-entry-id" id="index-ecl_005fcdfloat"></a>
|
|
<a class="anchor" id="ecl_005fclfloat"></a><a class="index-entry-id" id="index-ecl_005fclfloat"></a>
|
|
|
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005ffixnum-2"><span class="category-def">Function: </span><span><code class="def-type">cl_fixnum</code> <strong class="def-name">ecl_fixnum</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005ffixnum-2'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fsingle_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">float</code> <strong class="def-name">ecl_single_float</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fsingle_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fdouble_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">double</code> <strong class="def-name">ecl_double_float</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fdouble_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005flong_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">long double</code> <strong class="def-name">ecl_long_float</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005flong_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fcsfloat-1"><span class="category-def">Function: </span><span><code class="def-type">float _Complex</code> <strong class="def-name">ecl_csfloat</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fcsfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fcdfloat-1"><span class="category-def">Function: </span><span><code class="def-type">double _Complex</code> <strong class="def-name">ecl_cdfloat</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fcdfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fclfloat-1"><span class="category-def">Function: </span><span><code class="def-type">long double _Complex</code> <strong class="def-name">ecl_clfloat</strong> <code class="def-code-arguments">(cl_object n)</code><a class="copiable-link" href='Numbers.html#index-ecl_005fclfloat-1'> ¶</a></span></dt>
|
|
<dd>
|
|
|
|
<p><b class="b">Description</b>
|
|
</p>
|
|
<p>These functions and macros extract a C number from a Lisp object. They do not check the type of the Lisp object as they typically just access directly the value from a C structure.
|
|
</p></dd></dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsubsection-level-extent" id="Numbers-_002d-Number-coercion">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Numbers.html#Numbers-_002d-ANSI-dictionary" accesskey="n" rel="next">ANSI dictionary</a>, Previous: <a href="Numbers.html#Numbers-_002d-Number-accessors" accesskey="p" rel="prev">Number accessors</a>, Up: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="u" rel="up">C Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsubsection" id="Number-coercion">2.10.7.4 Number coercion</h4>
|
|
<p>Checked conversion from Lisp types to C numbers
|
|
</p>
|
|
<h4 class="subsubheading" id="Functions-2">Functions</h4>
|
|
<a class="anchor" id="ecl_005fto_005ffixnum"></a><a class="index-entry-id" id="index-ecl_005fto_005ffixnum"></a>
|
|
<a class="anchor" id="ecl_005fto_005funsigned_005finteger"></a><a class="index-entry-id" id="index-ecl_005fto_005funsigned_005finteger"></a>
|
|
<a class="anchor" id="ecl_005fto_005ffloat"></a><a class="index-entry-id" id="index-ecl_005fto_005ffloat"></a>
|
|
<a class="anchor" id="ecl_005fto_005fdouble"></a><a class="index-entry-id" id="index-ecl_005fto_005fdouble"></a>
|
|
<a class="anchor" id="ecl_005fto_005flong_005fdouble"></a><a class="index-entry-id" id="index-ecl_005fto_005flong_005fdouble"></a>
|
|
<a class="anchor" id="ecl_005fto_005fcsfloat"></a><a class="index-entry-id" id="index-ecl_005fto_005fcsfloat"></a>
|
|
<a class="anchor" id="ecl_005fto_005fcdfloat"></a><a class="index-entry-id" id="index-ecl_005fto_005fcdfloat"></a>
|
|
<a class="anchor" id="ecl_005fto_005fclfloat"></a><a class="index-entry-id" id="index-ecl_005fto_005fclfloat"></a>
|
|
<a class="anchor" id="ecl_005fto_005fuint8_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fuint8_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fint8_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fint8_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fuint16_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fuint16_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fint16_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fint16_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fuint32_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fuint32_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fint32_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fint32_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fuint64_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fuint64_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fint64_005ft"></a><a class="index-entry-id" id="index-ecl_005fto_005fint64_005ft"></a>
|
|
<a class="anchor" id="ecl_005fto_005fshort"></a><a class="index-entry-id" id="index-ecl_005fto_005fshort"></a>
|
|
<a class="anchor" id="ecl_005fto_005fushort"></a><a class="index-entry-id" id="index-ecl_005fto_005fushort"></a>
|
|
<a class="anchor" id="ecl_005fto_005fint"></a><a class="index-entry-id" id="index-ecl_005fto_005fint"></a>
|
|
<a class="anchor" id="ecl_005fto_005fuint"></a><a class="index-entry-id" id="index-ecl_005fto_005fuint"></a>
|
|
<a class="anchor" id="ecl_005fto_005flong"></a><a class="index-entry-id" id="index-ecl_005fto_005flong"></a>
|
|
<a class="anchor" id="ecl_005fto_005fulong"></a><a class="index-entry-id" id="index-ecl_005fto_005fulong"></a>
|
|
<a class="anchor" id="ecl_005fto_005flong_005flong"></a><a class="index-entry-id" id="index-ecl_005fto_005flong_005flong"></a>
|
|
<a class="anchor" id="ecl_005fto_005fulong_005flong"></a><a class="index-entry-id" id="index-ecl_005fto_005fulong_005flong"></a>
|
|
|
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fto_005ffixnum-1"><span class="category-def">Function: </span><span><code class="def-type">cl_fixnum</code> <strong class="def-name">ecl_to_fixnum</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005ffixnum-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005funsigned_005finteger-1"><span class="category-def">Function: </span><span><code class="def-type">cl_index</code> <strong class="def-name">ecl_to_unsigned_integer</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005funsigned_005finteger-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005ffloat-1"><span class="category-def">Function: </span><span><code class="def-type">float</code> <strong class="def-name">ecl_to_float</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005ffloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fdouble-1"><span class="category-def">Function: </span><span><code class="def-type">double</code> <strong class="def-name">ecl_to_double</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fdouble-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005flong_005fdouble-1"><span class="category-def">Function: </span><span><code class="def-type">long double</code> <strong class="def-name">ecl_to_long_double</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005flong_005fdouble-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fcsfloat-1"><span class="category-def">Function: </span><span><code class="def-type">float _Complex</code> <strong class="def-name">ecl_to_csfloat</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fcsfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fcdfloat-1"><span class="category-def">Function: </span><span><code class="def-type">double _Complex</code> <strong class="def-name">ecl_to_cdfloat</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fcdfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fclfloat-1"><span class="category-def">Function: </span><span><code class="def-type">long double _Complex</code> <strong class="def-name">ecl_to_clfloat</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fclfloat-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fuint8_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">uint8_t</code> <strong class="def-name">ecl_to_uint8_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fuint8_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fint8_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">int8_t</code> <strong class="def-name">ecl_to_int8_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fint8_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fuint16_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">uint16_t</code> <strong class="def-name">ecl_to_uint16_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fuint16_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fint16_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">int16_t</code> <strong class="def-name">ecl_to_int16_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fint16_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fuint32_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">uint32_t</code> <strong class="def-name">ecl_to_uint32_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fuint32_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fint32_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">int32_t</code> <strong class="def-name">ecl_to_int32_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fint32_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fuint64_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">uint64_t</code> <strong class="def-name">ecl_to_uint64_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fuint64_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fint64_005ft-1"><span class="category-def">Function: </span><span><code class="def-type">int64_t</code> <strong class="def-name">ecl_to_int64_t</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fint64_005ft-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fshort-1"><span class="category-def">Function: </span><span><code class="def-type">short</code> <strong class="def-name">ecl_to_short</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fshort-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fushort-1"><span class="category-def">Function: </span><span><code class="def-type">unsigned short</code> <strong class="def-name">ecl_to_ushort</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fushort-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fint-1"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">ecl_to_int</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fint-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fuint-1"><span class="category-def">Function: </span><span><code class="def-type">unsigned int</code> <strong class="def-name">ecl_to_uint</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fuint-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">long</code> <strong class="def-name">ecl_to_long</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005flong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fulong-1"><span class="category-def">Function: </span><span><code class="def-type">unsigned long</code> <strong class="def-name">ecl_to_ulong</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fulong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005flong_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">long long</code> <strong class="def-name">ecl_to_long_long</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005flong_005flong-1'> ¶</a></span></dt>
|
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fto_005fulong_005flong-1"><span class="category-def">Function: </span><span><code class="def-type">unsigned long long</code> <strong class="def-name">ecl_to_ulong_long</strong> <code class="def-code-arguments">(cl_object n);</code><a class="copiable-link" href='Numbers.html#index-ecl_005fto_005fulong_005flong-1'> ¶</a></span></dt>
|
|
<dd>
|
|
|
|
<p><b class="b">Description</b>
|
|
</p>
|
|
<p>These functions and macros convert a Lisp object to the corresponding
|
|
C number type. The conversion is done through a coercion process which
|
|
may signal an error if the argument does not fit the expected type.
|
|
</p></dd></dl>
|
|
|
|
<hr>
|
|
</div>
|
|
<div class="subsubsection-level-extent" id="Numbers-_002d-ANSI-dictionary">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Previous: <a href="Numbers.html#Numbers-_002d-Number-coercion" accesskey="p" rel="prev">Number coercion</a>, Up: <a href="Numbers.html#Numbers-_002d-C-Reference" accesskey="u" rel="up">C Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<h4 class="subsubsection" id="ANSI-dictionary-1">2.10.7.5 ANSI dictionary</h4>
|
|
<p>Common Lisp and C equivalence
|
|
</p>
|
|
<table class="multitable">
|
|
<thead><tr><th width="30%">Lisp symbol</th><th width="70%">C function</th></tr></thead>
|
|
<tbody><tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm">=</a></td><td width="70%">cl_object cl_E(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm">/=</a></td><td width="70%">cl_object cl_NE(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm"><</a></td><td width="70%">cl_object cl_L(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm">></a></td><td width="70%">cl_object cl_G(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm"><=</a></td><td width="70%">cl_object cl_LE(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm">>=</a></td><td width="70%">cl_object cl_GE(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_max_m.htm">max</a></td><td width="70%">cl_object cl_max(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_max_m.htm">min</a></td><td width="70%">cl_object cl_min(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_minusp.htm">minusp</a></td><td width="70%">cl_object cl_minusp(cl_object real)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_minusp.htm">plusp</a></td><td width="70%">cl_object cl_plusp(cl_object real)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_zerop.htm">zerop</a></td><td width="70%">cl_object cl_zerop(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">floor</a></td><td width="70%">cl_object cl_floor(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">ffloor</a></td><td width="70%">cl_object cl_ffloor(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">ceiling</a></td><td width="70%">cl_object cl_ceiling(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">fceiling</a></td><td width="70%">cl_object cl_fceiling(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">truncate</a></td><td width="70%">cl_object cl_truncate(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">ftruncate</a></td><td width="70%">cl_object cl_ftruncate(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">round</a></td><td width="70%">cl_object cl_round(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floorc.htm">fround</a></td><td width="70%">cl_object cl_fround(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sin_c.htm">sin</a></td><td width="70%">cl_object cl_sin(cl_object radians)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sin_c.htm">cos</a></td><td width="70%">cl_object cl_cos(cl_object radians)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sin_c.htm">tan</a></td><td width="70%">cl_object cl_tan(cl_object radians)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_asin_.htm">asin</a></td><td width="70%">cl_object cl_asin(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_asin_.htm">acos</a></td><td width="70%">cl_object cl_acos(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_asin_.htm">atan</a></td><td width="70%">cl_object cl_atan(cl_narg narg, cl_object number1, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">sinh</a></td><td width="70%">cl_object cl_sinh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">cosh</a></td><td width="70%">cl_object cl_cosh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">tanh</a></td><td width="70%">cl_object cl_tanh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">asinh</a></td><td width="70%">cl_object cl_asinh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">acosh</a></td><td width="70%">cl_object cl_acosh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm">atanh</a></td><td width="70%">cl_object cl_atanh(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_st.htm">*</a></td><td width="70%">cl_object cl_X(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_pl.htm">+</a></td><td width="70%">cl_object cl_P(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f__.htm">-</a></td><td width="70%">cl_object cl_M(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sl.htm">/</a></td><td width="70%">cl_object cl_N(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_1pl_1_.htm">1+</a></td><td width="70%">cl_object cl_1P(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_1pl_1_.htm">1-</a></td><td width="70%">cl_object cl_1M(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_abs.htm">abs</a></td><td width="70%">cl_object cl_abs(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_evenpc.htm">evenp</a></td><td width="70%">cl_object cl_evenp(cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_evenpc.htm">oddp</a></td><td width="70%">cl_object cl_oddp(cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_exp_e.htm">exp</a></td><td width="70%">cl_object cl_exp(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_exp_e.htm">expt</a></td><td width="70%">cl_object cl_expt(cl_object base, cl_object power)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_gcd.htm">gcd</a></td><td width="70%">cl_object cl_gcd(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_lcm.htm">lcm</a></td><td width="70%">cl_object cl_lcm(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_log.htm">log</a></td><td width="70%">cl_object cl_log(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mod_r.htm">mod</a></td><td width="70%">cl_object cl_mod(cl_object number, cl_object divisor)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mod_r.htm">rem</a></td><td width="70%">cl_object cl_rem(cl_object number, cl_object divisor)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_signum.htm">signum</a></td><td width="70%">cl_object cl_signum(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sqrt_.htm">sqrt</a></td><td width="70%">cl_object cl_sqrt(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_sqrt.htm">isqrt</a></td><td width="70%">cl_object cl_isqrt(cl_object natural)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mk_rnd.htm">make-random-state</a></td><td width="70%">cl_object cl_make_random_state(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_random.htm">random</a></td><td width="70%">cl_object cl_random(cl_narg narg, cl_object limit, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_rnd_st.htm">random-state-p</a></td><td width="70%">cl_object cl_random_state_p(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_nump.htm">numberp</a></td><td width="70%">cl_object cl_numberp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_cis.htm">cis</a></td><td width="70%">cl_object cl_cis(cl_object radians)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_comp_2.htm">complex</a></td><td width="70%">cl_object cl_complex(cl_narg narg, cl_object realpart, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_comp_3.htm">complexp</a></td><td width="70%">cl_object cl_complexp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_conjug.htm">conjugate</a></td><td width="70%">cl_object cl_conjugate(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_phase.htm">phase</a></td><td width="70%">cl_object cl_phase(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_realpa.htm">realpart</a></td><td width="70%">cl_object cl_realpart(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_realpa.htm">imagpart</a></td><td width="70%">cl_object cl_imagpart(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_upgrad.htm">upgraded-complex-part-type</a></td><td width="70%">cl_object cl_upgraded_complex_part_type(cl_narg narg, cl_object typespec, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_realp.htm">realp</a></td><td width="70%">cl_object cl_realp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_numera.htm">numerator</a></td><td width="70%">cl_object cl_numerator(cl_object rational)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_numera.htm">denominator</a></td><td width="70%">cl_object cl_denominator(cl_object rational)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ration.htm">rational</a></td><td width="70%">cl_object cl_rational(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ration.htm">rationalize</a></td><td width="70%">cl_object cl_rationalize(cl_object number)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_rati_1.htm">rationalp</a></td><td width="70%">cl_object cl_rationalp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ash.htm">ash</a></td><td width="70%">cl_object cl_ash(cl_object integer, cl_object count)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_intege.htm">integer-length</a></td><td width="70%">cl_object cl_integer_length(cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_inte_1.htm">integerp</a></td><td width="70%">cl_object cl_integerp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_parse_.htm">parse-integer</a></td><td width="70%">cl_object cl_parse_integer(cl_narg narg, cl_object string, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_boole.htm">boole</a></td><td width="70%">cl_object cl_boole(cl_object op, cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logand</a></td><td width="70%">cl_object cl_logand(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logandc1</a></td><td width="70%">cl_object cl_logandc1(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logandc2</a></td><td width="70%">cl_object cl_logandc2(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logeqv</a></td><td width="70%">cl_object cl_logeqv(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logior</a></td><td width="70%">cl_object cl_logior(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">lognand</a></td><td width="70%">cl_object cl_lognand(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">lognor</a></td><td width="70%">cl_object cl_lognor(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">lognot</a></td><td width="70%">cl_object cl_lognot(cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logorc1</a></td><td width="70%">cl_object cl_logorc1(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logorc2</a></td><td width="70%">cl_object cl_logorc2(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm">logxor</a></td><td width="70%">cl_object cl_logxor(cl_narg narg, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logbtp.htm">logbitp</a></td><td width="70%">cl_object cl_logbitp(cl_object index, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logcou.htm">logcount</a></td><td width="70%">cl_object cl_logcount(cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_logtes.htm">logtest</a></td><td width="70%">cl_object cl_logtest(cl_object integer1, cl_object integer2)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_by_by.htm">byte</a></td><td width="70%">cl_object cl_byte(cl_object size, cl_object position)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_by_by.htm">bytes-size</a></td><td width="70%">cl_object cl_byte_size(cl_object bytespec)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_by_by.htm">byte-position</a></td><td width="70%">cl_object cl_byte_position(cl_object bytespec)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_deposi.htm">deposit-field</a></td><td width="70%">cl_object cl_deposit_field(cl_object newbyte, cl_object bytespec, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dpb.htm">dpb</a></td><td width="70%">cl_object cl_dpb(cl_object newbyte, cl_object bytespec, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ldb.htm">ldb</a></td><td width="70%">cl_object cl_ldb(cl_object bytespec, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ldb_te.htm">ldb-test</a></td><td width="70%">cl_object cl_ldb_test(cl_object bytespec, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mask_f.htm">mask-field</a></td><td width="70%">cl_object cl_mask_field(cl_object bytespec, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">decode-float</a></td><td width="70%">cl_object cl_decode_float(cl_object float)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">scale-float</a></td><td width="70%">cl_object cl_scale_float(cl_object float, cl_object integer)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">float-radix</a></td><td width="70%">cl_object cl_float_radix(cl_object float)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">float-sign</a></td><td width="70%">cl_object cl_float_sign(cl_narg narg, cl_object float1, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">float-digits</a></td><td width="70%">cl_object cl_float_digits(cl_object float)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">float-precision</a></td><td width="70%">cl_object cl_float_precision(cl_object float)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm">integer-decode-float</a></td><td width="70%">cl_object cl_integer_decode_float(cl_object float)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_float.htm">float</a></td><td width="70%">cl_object cl_float(cl_narg narg, cl_object number, ...)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_floatp.htm">floatp</a></td><td width="70%">cl_object cl_floatp(cl_object object)</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_arithm.htm">arithmetic-error-operands</a></td><td width="70%">[Only in Common Lisp]</td></tr>
|
|
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_arithm.htm">arithmetic-error-operation</a></td><td width="70%">[Only in Common Lisp]</td></tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="footnotes-segment">
|
|
<hr>
|
|
<h4 class="footnotes-heading">Footnotes</h4>
|
|
|
|
<h5 class="footnote-body-heading"><a id="FOOT1" href="Numbers.html#DOCF1">(1)</a></h5>
|
|
<p>The main reason for this is that some numeric
|
|
functions for C complex numbers return mathematically incorrect
|
|
values, for example sinh(i*∞) returns i*NaN instead of the
|
|
mathematically correct i*∞. Keeping this consistent with our own
|
|
implementation of complex arithmetic that is used when C complex
|
|
numbers are not available would require to much work. Furthermore,
|
|
complex arithmetic with infinities is unreliable anyway, since it
|
|
quickly leads to NaN values (consider i*∞ = (0+i*1)*(∞+i*0) = NaN+i*∞;
|
|
even this simple example is already mathematically incorrect).</p>
|
|
<h5 class="footnote-body-heading"><a id="FOOT2" href="Numbers.html#DOCF2">(2)</a></h5>
|
|
<p>The reason for this behaviour
|
|
is twofold: first, the approach taken by ECL is mathematically more
|
|
sensible in a number system with signed zero and second, it is
|
|
consistent with the specification of multi-valued complex functions in
|
|
the C programming language.</p>
|
|
</div>
|
|
<hr>
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Characters.html#Characters" accesskey="n" rel="next">Characters</a>, Previous: <a href="Packages.html" accesskey="p" rel="prev">Packages</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|