You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
6.4 KiB
HTML
130 lines
6.4 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<!-- This manual is for GNU MPC, a library for multiple precision complex arithmetic,
|
|
version 1.0.3 of February 2015.
|
|
|
|
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 INRIA
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
any later version published by the Free Software Foundation; with no
|
|
Invariant Sections. A copy of the license is included in the section
|
|
entitled "GNU Free Documentation License." -->
|
|
<!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
|
|
<head>
|
|
<title>Miscellaneous Complex Functions (GNU MPC 1.0.3)</title>
|
|
|
|
<meta name="description" content="Miscellaneous Complex Functions (GNU MPC 1.0.3)">
|
|
<meta name="keywords" content="Miscellaneous Complex Functions (GNU MPC 1.0.3)">
|
|
<meta name="resource-type" content="document">
|
|
<meta name="distribution" content="global">
|
|
<meta name="Generator" content="makeinfo">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link href="index.html#Top" rel="start" title="Top">
|
|
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
|
|
<link href="Complex-Functions.html#Complex-Functions" rel="up" title="Complex Functions">
|
|
<link href="Advanced-Functions.html#Advanced-Functions" rel="next" title="Advanced Functions">
|
|
<link href="Trigonometric-Functions.html#Trigonometric-Functions" rel="prev" title="Trigonometric Functions">
|
|
<style type="text/css">
|
|
<!--
|
|
a.summary-letter {text-decoration: none}
|
|
blockquote.indentedblock {margin-right: 0em}
|
|
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
|
|
blockquote.smallquotation {font-size: smaller}
|
|
div.display {margin-left: 3.2em}
|
|
div.example {margin-left: 3.2em}
|
|
div.lisp {margin-left: 3.2em}
|
|
div.smalldisplay {margin-left: 3.2em}
|
|
div.smallexample {margin-left: 3.2em}
|
|
div.smalllisp {margin-left: 3.2em}
|
|
kbd {font-style: oblique}
|
|
pre.display {font-family: inherit}
|
|
pre.format {font-family: inherit}
|
|
pre.menu-comment {font-family: serif}
|
|
pre.menu-preformatted {font-family: serif}
|
|
pre.smalldisplay {font-family: inherit; font-size: smaller}
|
|
pre.smallexample {font-size: smaller}
|
|
pre.smallformat {font-family: inherit; font-size: smaller}
|
|
pre.smalllisp {font-size: smaller}
|
|
span.nolinebreak {white-space: nowrap}
|
|
span.roman {font-family: initial; font-weight: normal}
|
|
span.sansserif {font-family: sans-serif; font-weight: normal}
|
|
ul.no-bullet {list-style: none}
|
|
-->
|
|
</style>
|
|
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
|
<a name="Miscellaneous-Complex-Functions"></a>
|
|
<div class="header">
|
|
<p>
|
|
Next: <a href="Advanced-Functions.html#Advanced-Functions" accesskey="n" rel="next">Advanced Functions</a>, Previous: <a href="Trigonometric-Functions.html#Trigonometric-Functions" accesskey="p" rel="prev">Trigonometric Functions</a>, Up: <a href="Complex-Functions.html#Complex-Functions" accesskey="u" rel="up">Complex Functions</a> [<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<hr>
|
|
<a name="Miscellaneous-Functions"></a>
|
|
<h3 class="section">5.10 Miscellaneous Functions</h3>
|
|
<a name="index-Miscellaneous-complex-functions"></a>
|
|
|
|
<dl>
|
|
<dt><a name="index-mpc_005furandom"></a>Function: <em>int</em> <strong>mpc_urandom</strong> <em>(mpc_t <var>rop</var>, gmp_randstate_t <var>state</var>)</em></dt>
|
|
<dd><p>Generate a uniformly distributed random complex in the unit square <em>[0,
|
|
1] x [0, 1]</em>. Return 0, unless an exponent in the real or imaginary part
|
|
is not in the current exponent range, in which case that part is set to NaN
|
|
and a zero value is returned. The second argument is a <code>gmp_randstate_t</code>
|
|
structure which should be created using the GMP <code>rand_init</code> function, see
|
|
the GMP manual.
|
|
</p></dd></dl>
|
|
|
|
<dl>
|
|
<dt><a name="index-mpc_005fget_005fversion"></a>Function: <em>const char *</em> <strong>mpc_get_version</strong> <em>(void)</em></dt>
|
|
<dd><p>Return the GNU MPC version, as a null-terminated string.
|
|
</p></dd></dl>
|
|
|
|
<dl>
|
|
<dt><a name="index-MPC_005fVERSION"></a>Macro: <strong>MPC_VERSION</strong></dt>
|
|
<dt><a name="index-MPC_005fVERSION_005fMAJOR"></a>Macro: <strong>MPC_VERSION_MAJOR</strong></dt>
|
|
<dt><a name="index-MPC_005fVERSION_005fMINOR"></a>Macro: <strong>MPC_VERSION_MINOR</strong></dt>
|
|
<dt><a name="index-MPC_005fVERSION_005fPATCHLEVEL"></a>Macro: <strong>MPC_VERSION_PATCHLEVEL</strong></dt>
|
|
<dt><a name="index-MPC_005fVERSION_005fSTRING"></a>Macro: <strong>MPC_VERSION_STRING</strong></dt>
|
|
<dd><p><code>MPC_VERSION</code> is the version of GNU MPC as a preprocessing constant.
|
|
<code>MPC_VERSION_MAJOR</code>, <code>MPC_VERSION_MINOR</code> and
|
|
<code>MPC_VERSION_PATCHLEVEL</code> are respectively the major, minor and
|
|
patch level of GNU MPC version, as preprocessing constants.
|
|
<code>MPC_VERSION_STRING</code> is the version as a string constant, which
|
|
can be compared to the result of <code>mpc_get_version</code> to check at
|
|
run time the header file and library used match:
|
|
</p><div class="example">
|
|
<pre class="example">if (strcmp (mpc_get_version (), MPC_VERSION_STRING))
|
|
fprintf (stderr, "Warning: header and library do not match\n");
|
|
</pre></div>
|
|
<p>Note: Obtaining different strings is not necessarily an error, as in
|
|
general, a program compiled with some old GNU MPC version can be
|
|
dynamically linked with a newer GNU MPC library version (if allowed by the
|
|
library versioning system).
|
|
</p></dd></dl>
|
|
|
|
<dl>
|
|
<dt><a name="index-MPC_005fVERSION_005fNUM"></a>Macro: <em>long</em> <strong>MPC_VERSION_NUM</strong> <em>(<var>major</var>, <var>minor</var>, <var>patchlevel</var>)</em></dt>
|
|
<dd><p>Create an integer in the same format as used by <code>MPC_VERSION</code> from the
|
|
given <var>major</var>, <var>minor</var> and <var>patchlevel</var>.
|
|
Here is an example of how to check the GNU MPC version at compile time:
|
|
</p><div class="example">
|
|
<pre class="example">#if (!defined(MPC_VERSION) || (MPC_VERSION<MPC_VERSION_NUM(2,1,0)))
|
|
# error "Wrong GNU MPC version."
|
|
#endif
|
|
</pre></div>
|
|
</dd></dl>
|
|
|
|
<hr>
|
|
<div class="header">
|
|
<p>
|
|
Next: <a href="Advanced-Functions.html#Advanced-Functions" accesskey="n" rel="next">Advanced Functions</a>, Previous: <a href="Trigonometric-Functions.html#Trigonometric-Functions" accesskey="p" rel="prev">Trigonometric Functions</a>, Up: <a href="Complex-Functions.html#Complex-Functions" accesskey="u" rel="up">Complex Functions</a> [<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|