blob: 0606546434dff5f98e2605f0f9a7fd8ffae3ca1f [file]
<html lang="en">
<head>
<title>ldexp - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Math.html#Math" title="Math">
<link rel="prev" href="isgreater.html#isgreater" title="isgreater">
<link rel="next" href="log.html#log" title="log">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="ldexp"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="log.html#log">log</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="isgreater.html#isgreater">isgreater</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Math.html#Math">Math</a>
<hr>
</div>
<h3 class="section">1.32 <code>ldexp</code>, <code>ldexpf</code>&mdash;load exponent</h3>
<p><a name="index-ldexp-96"></a><a name="index-ldexpf-97"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;math.h&gt;
double ldexp(double <var>val</var>, int <var>exp</var>);
float ldexpf(float <var>val</var>, int <var>exp</var>);
</pre>
<p><strong>Description</strong><br>
<code>ldexp</code> calculates the value
<var>val</var> times 2 to the power <var>exp</var>.
<code>ldexpf</code> is identical, save that it takes and returns <code>float</code>
rather than <code>double</code> values.
<p><br>
<strong>Returns</strong><br>
<code>ldexp</code> returns the calculated value.
<p>Underflow and overflow both set <code>errno</code> to <code>ERANGE</code>.
On underflow, <code>ldexp</code> and <code>ldexpf</code> return 0.0.
On overflow, <code>ldexp</code> returns plus or minus <code>HUGE_VAL</code>.
<p><br>
<strong>Portability</strong><br>
<code>ldexp</code> is ANSI. <code>ldexpf</code> is an extension.
<p><br>
</body></html>