summaryrefslogtreecommitdiff
path: root/devdocs/c/numeric%2Fcomplex%2Fctanh.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/c/numeric%2Fcomplex%2Fctanh.html')
-rw-r--r--devdocs/c/numeric%2Fcomplex%2Fctanh.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/devdocs/c/numeric%2Fcomplex%2Fctanh.html b/devdocs/c/numeric%2Fcomplex%2Fctanh.html
new file mode 100644
index 00000000..d3d586b4
--- /dev/null
+++ b/devdocs/c/numeric%2Fcomplex%2Fctanh.html
@@ -0,0 +1,67 @@
+ <h1 id="firstHeading" class="firstHeading">ctanhf, ctanh, ctanhl</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;complex.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">float complex ctanhf( float complex z );</pre>
+</td> <td> (1) </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">double complex ctanh( double complex z );</pre>
+</td> <td> (2) </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">long double complex ctanhl( long double complex z );</pre>
+</td> <td> (3) </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;tgmath.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define tanh( z )</pre>
+</td> <td> (4) </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> </table> <div class="t-li1">
+<span class="t-li">1-3)</span> Computes the complex hyperbolic tangent of <code>z</code>.</div> <div class="t-li1">
+<span class="t-li">4)</span> Type-generic macro: If <code>z</code> has type <code><span class="kw4">long</span> <span class="kw4">double</span> <a href="http://en.cppreference.com/w/c/numeric/complex/complex"><span class="kw743">complex</span></a></code>, <code>ctanhl</code> is called. if <code>z</code> has type <code><span class="kw4">double</span> <a href="http://en.cppreference.com/w/c/numeric/complex/complex"><span class="kw743">complex</span></a></code>, <code>ctanh</code> is called, if <code>z</code> has type <code><span class="kw4">float</span> <a href="http://en.cppreference.com/w/c/numeric/complex/complex"><span class="kw743">complex</span></a></code>, <code>ctanhf</code> is called. If <code>z</code> is real or integer, then the macro invokes the corresponding real function (<code>tanhf</code>, <code><a href="http://en.cppreference.com/w/c/numeric/math/tanh"><span class="kw678">tanh</span></a></code>, <code>tanhl</code>). If <code>z</code> is imaginary, then the macro invokes the corresponding real version of the function <code><a href="../math/tan" title="c/numeric/math/tan">tan</a></code>, implementing the formula tanh(iy) = i tan(y), and the return type is imaginary.</div> <h3 id="Parameters"> Parameters</h3> <table class="t-par-begin"> <tr class="t-par"> <td> z </td> <td> - </td> <td> complex argument </td>
+</tr>
+</table> <h3 id="Return_value"> Return value</h3> <p>If no errors occur, complex hyperbolic tangent of <code>z</code> is returned</p>
+<h3 id="Error_handling_and_special_values"> Error handling and special values</h3> <p>Errors are reported consistent with <a href="../math/math_errhandling" title="c/numeric/math/math errhandling">math_errhandling</a></p>
+<p>If the implementation supports IEEE floating-point arithmetic,</p>
+<ul>
+<li> <code>ctanh<span class="br0">(</span><a href="http://en.cppreference.com/w/c/numeric/complex/conj"><span class="kw760">conj</span></a><span class="br0">(</span>z<span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> <a href="http://en.cppreference.com/w/c/numeric/complex/conj"><span class="kw760">conj</span></a><span class="br0">(</span>ctanh<span class="br0">(</span>z<span class="br0">)</span><span class="br0">)</span></code> </li>
+<li> <code>ctanh(-z) == -ctanh(z)</code> </li>
+<li> If <code>z</code> is <code>+0+0i</code>, the result is <code>+0+0i</code> </li>
+<li> If <code>z</code> is <code>x+∞i</code> (for any<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> finite x), the result is <code>NaN+NaNi</code> and <code><a href="../fenv/fe_exceptions" title="c/numeric/fenv/FE exceptions">FE_INVALID</a></code> is raised </li>
+<li> If <code>z</code> is <code>x+NaN</code> (for any<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">[2]</a></sup> finite x), the result is <code>NaN+NaNi</code> and <code><a href="../fenv/fe_exceptions" title="c/numeric/fenv/FE exceptions">FE_INVALID</a></code> may be raised </li>
+<li> If <code>z</code> is <code>+∞+yi</code> (for any finite positive y), the result is <code>1+0i</code> </li>
+<li> If <code>z</code> is <code>+∞+∞i</code>, the result is <code>1±0i</code> (the sign of the imaginary part is unspecified) </li>
+<li> If <code>z</code> is <code>+∞+NaNi</code>, the result is <code>1±0i</code> (the sign of the imaginary part is unspecified) </li>
+<li> If <code>z</code> is <code>NaN+0i</code>, the result is <code>NaN+0i</code> </li>
+<li> If <code>z</code> is <code>NaN+yi</code> (for any non-zero y), the result is <code>NaN+NaNi</code> and <code><a href="../fenv/fe_exceptions" title="c/numeric/fenv/FE exceptions">FE_INVALID</a></code> may be raised </li>
+<li> If <code>z</code> is <code>NaN+NaNi</code>, the result is <code>NaN+NaNi</code> </li>
+</ul> <ol class="references"> <li id="cite_note-1"> <span class="reference-text">per <a rel="nofollow" class="external text" href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1892.htm#dr_471">DR471</a>, this only holds for non-zero x. If <code>z</code> is <code>0+∞i</code>, the result should be <code>0+NaNi</code></span> </li> <li id="cite_note-2"> <span class="reference-text">per <a rel="nofollow" class="external text" href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1892.htm#dr_471">DR471</a>, this only holds for non-zero x. If <code>z</code> is <code>0+NaNi</code>, the result should be <code>0+NaNi</code></span> </li> </ol> <h3 id="Notes"> Notes</h3> Mathematical definition of hyperbolic tangent is tanh z = <span><span>ez-e-z</span><span>/</span><span>ez+e-z</span></span> <p>Hyperbolic tangent is an analytical function on the complex plane and has no branch cuts. It is periodic with respect to the imaginary component, with period πi, and has poles of the first order along the imaginary line, at coordinates (0, π(1/2 + n)). However no common floating-point representation is able to represent π/2 exactly, thus there is no value of the argument for which a pole error occurs.</p>
+<h3 id="Example"> Example</h3> <div class="t-example"> <div class="c source-c"><pre data-language="c">#include &lt;stdio.h&gt;
+#include &lt;math.h&gt;
+#include &lt;complex.h&gt;
+
+int main(void)
+{
+ double complex z = ctanh(1); // behaves like real tanh along the real line
+ printf("tanh(1+0i) = %f%+fi (tanh(1)=%f)\n", creal(z), cimag(z), tanh(1));
+
+ double complex z2 = ctanh(I); // behaves like tangent along the imaginary line
+ printf("tanh(0+1i) = %f%+fi ( tan(1)=%f)\n", creal(z2), cimag(z2), tan(1));
+}</pre></div> <p>Output:</p>
+<div class="text source-text"><pre data-language="c">tanh(1+0i) = 0.761594+0.000000i (tanh(1)=0.761594)
+tanh(0+1i) = 0.000000+1.557408i ( tan(1)=1.557408)</pre></div> </div> <h3 id="References"> References</h3> <ul>
+<li> C11 standard (ISO/IEC 9899:2011): </li>
+<ul>
+<li> 7.3.6.6 The ctanh functions (p: 194) </li>
+<li> 7.25 Type-generic math &lt;tgmath.h&gt; (p: 373-375) </li>
+<li> G.6.2.6 The ctanh functions (p: 542) </li>
+<li> G.7 Type-generic math &lt;tgmath.h&gt; (p: 545) </li>
+</ul>
+<li> C99 standard (ISO/IEC 9899:1999): </li>
+<ul>
+<li> 7.3.6.6 The ctanh functions (p: 176) </li>
+<li> 7.22 Type-generic math &lt;tgmath.h&gt; (p: 335-337) </li>
+<li> G.6.2.6 The ctanh functions (p: 477) </li>
+<li> G.7 Type-generic math &lt;tgmath.h&gt; (p: 480) </li>
+</ul>
+</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="csinh" title="c/numeric/complex/csinh"> <span class="t-lines"><span>csinh</span><span>csinhf</span><span>csinhl</span></span></a></div>
+<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> computes the complex hyperbolic sine <br> <span class="t-mark">(function)</span> </td>
+</tr> <tr class="t-dsc"> <td> <div><a href="ccosh" title="c/numeric/complex/ccosh"> <span class="t-lines"><span>ccosh</span><span>ccoshf</span><span>ccoshl</span></span></a></div>
+<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> computes the complex hyperbolic cosine <br> <span class="t-mark">(function)</span> </td>
+</tr> <tr class="t-dsc"> <td> <div><a href="catanh" title="c/numeric/complex/catanh"> <span class="t-lines"><span>catanh</span><span>catanhf</span><span>catanhl</span></span></a></div>
+<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> computes the complex arc hyperbolic tangent <br> <span class="t-mark">(function)</span> </td>
+</tr> <tr class="t-dsc"> <td> <div><a href="../math/tanh" title="c/numeric/math/tanh"> <span class="t-lines"><span>tanh</span><span>tanhf</span><span>tanhl</span></span></a></div>
+<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> computes hyperbolic tangent (\({\small\tanh{x} }\)tanh(x)) <br> <span class="t-mark">(function)</span> </td>
+</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/numeric/complex/tanh" title="cpp/numeric/complex/tanh">C++ documentation</a></span> for <code>tanh</code> </td>
+</tr> </table> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
+ <a href="https://en.cppreference.com/w/c/numeric/complex/ctanh" class="_attribution-link">https://en.cppreference.com/w/c/numeric/complex/ctanh</a>
+ </p>
+</div>