blob: c9eb3fe2b18ddc9f417cbcd0e44d3fc7e6e58ae4 [file]
<html lang="en">
<head>
<title>log1p - 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="log10.html#log10" title="log10">
<link rel="next" href="log2.html#log2" title="log2">
<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="log1p"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="log2.html#log2">log2</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="log10.html#log10">log10</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Math.html#Math">Math</a>
<hr>
</div>
<h3 class="section">1.35 <code>log1p</code>, <code>log1pf</code>&mdash;log of <code>1 + </code><var>x</var></h3>
<p><a name="index-log1p-102"></a><a name="index-log1pf-103"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;math.h&gt;
double log1p(double <var>x</var>);
float log1pf(float <var>x</var>);
</pre>
<p><strong>Description</strong><br>
<code>log1p</code> calculates
the natural logarithm of <code>1+</code><var>x</var>. You can use <code>log1p</code> rather
than `<code>log(1+</code><var>x</var><code>)</code>' for greater precision when <var>x</var> is very
small.
<p><code>log1pf</code> calculates the same thing, but accepts and returns
<code>float</code> values rather than <code>double</code>.
<p><br>
<strong>Returns</strong><br>
<code>log1p</code> returns a <code>double</code>, the natural log of <code>1+</code><var>x</var>.
<code>log1pf</code> returns a <code>float</code>, the natural log of <code>1+</code><var>x</var>.
<p><br>
<strong>Portability</strong><br>
Neither <code>log1p</code> nor <code>log1pf</code> is required by ANSI C or by the System V
Interface Definition (Issue 2).
<p><br>
</body></html>