diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/c/numeric%2Fmath%2Fsinh.html | |
new repository
Diffstat (limited to 'devdocs/c/numeric%2Fmath%2Fsinh.html')
| -rw-r--r-- | devdocs/c/numeric%2Fmath%2Fsinh.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/devdocs/c/numeric%2Fmath%2Fsinh.html b/devdocs/c/numeric%2Fmath%2Fsinh.html new file mode 100644 index 00000000..bedcb5d3 --- /dev/null +++ b/devdocs/c/numeric%2Fmath%2Fsinh.html @@ -0,0 +1,77 @@ + <h1 id="firstHeading" class="firstHeading">sinh, sinhf, sinhl</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><math.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">float sinhf( float arg );</pre> +</td> <td> (1) </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl"> <td> <pre data-language="c">double sinh( double arg );</pre> +</td> <td> (2) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">long double sinhl( long double arg );</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><tgmath.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define sinh( arg )</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 hyperbolic sine of <code>arg</code>.</div> <div class="t-li1"> +<span class="t-li">4)</span> Type-generic macro: If the argument has type <code>long double</code>, <code>sinhl</code> is called. Otherwise, if the argument has integer type or the type <code>double</code>, <code>sinh</code> is called. Otherwise, <code>sinhf</code> is called. If the argument is complex, then the macro invokes the corresponding complex function (<code><a href="http://en.cppreference.com/w/c/numeric/complex/csinh"><span class="kw811">csinhf</span></a></code>, <code><a href="http://en.cppreference.com/w/c/numeric/complex/csinh"><span class="kw810">csinh</span></a></code>, <code><a href="http://en.cppreference.com/w/c/numeric/complex/csinh"><span class="kw812">csinhl</span></a></code>).</div> <h3 id="Parameters"> Parameters</h3> <table class="t-par-begin"> <tr class="t-par"> <td> arg </td> <td> - </td> <td> floating point value representing a hyperbolic angle </td> +</tr> +</table> <h3 id="Return_value"> Return value</h3> If no errors occur, the hyperbolic sine of <code>arg</code> (sinh(arg), or <span><span>earg-e-arg</span><span>/</span><span>2</span></span>) is returned. <p>If a range error due to overflow occurs, <code><a href="huge_val" title="c/numeric/math/HUGE VAL">±HUGE_VAL</a></code>, <code>±HUGE_VALF</code>, or <code>±HUGE_VALL</code> is returned.</p> +<p>If a range error occurs due to underflow, the correct result (after rounding) is returned.</p> +<h3 id="Error_handling"> Error handling</h3> <p>Errors are reported as specified in <a href="math_errhandling" title="c/numeric/math/math errhandling"><code>math_errhandling</code></a>.</p> +<p>If the implementation supports IEEE floating-point arithmetic (IEC 60559),</p> +<ul> +<li> if the argument is ±0 or ±∞, it is returned unmodified </li> +<li> if the argument is NaN, NaN is returned </li> +</ul> <h3 id="Notes"> Notes</h3> <p><a rel="nofollow" class="external text" href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/sinh.html">POSIX specifies</a> that in case of underflow, <code>arg</code> is returned unmodified, and if that is not supported, an implementation-defined value no greater than <code><a href="../../types/limits" title="c/types/limits">DBL_MIN</a></code>, <code><a href="../../types/limits" title="c/types/limits">FLT_MIN</a></code>, and <code><a href="../../types/limits" title="c/types/limits">LDBL_MIN</a></code> is returned.</p> +<h3 id="Example"> Example</h3> <div class="t-example"> <div class="c source-c"><pre data-language="c">#include <stdio.h> +#include <math.h> +#include <errno.h> +#include <fenv.h> + +// #pragma STDC FENV_ACCESS ON +int main(void) +{ + printf("sinh(1) = %f\nsinh(-1)=%f\n", sinh(1), sinh(-1)); + printf("log(sinh(1) + cosh(1))=%f\n", log(sinh(1)+cosh(1))); + // special values + printf("sinh(+0) = %f\nsinh(-0)=%f\n", sinh(0.0), sinh(-0.0)); + // error handling + errno=0; feclearexcept(FE_ALL_EXCEPT); + printf("sinh(710.5) = %f\n", sinh(710.5)); + if(errno == ERANGE) perror(" errno == ERANGE"); + if(fetestexcept(FE_OVERFLOW)) puts(" FE_OVERFLOW raised"); +}</pre></div> <p>Possible output:</p> +<div class="text source-text"><pre data-language="c">sinh(1) = 1.175201 +sinh(-1)=-1.175201 +log(sinh(1) + cosh(1))=1.000000 +sinh(+0) = 0.000000 +sinh(-0)=-0.000000 +sinh(710.5) = inf + errno == ERANGE: Numerical result out of range + FE_OVERFLOW raised</pre></div> </div> <h3 id="References"> References</h3> <ul> +<li> C17 standard (ISO/IEC 9899:2018): </li> +<ul> +<li> 7.12.5.5 The sinh functions (p: 176) </li> +<li> 7.25 Type-generic math <tgmath.h> (p: 272-273) </li> +<li> F.10.2.5 The sinh functions (p: 379) </li> +</ul> +<li> C11 standard (ISO/IEC 9899:2011): </li> +<ul> +<li> 7.12.5.5 The sinh functions (p: 241-242) </li> +<li> 7.25 Type-generic math <tgmath.h> (p: 373-375) </li> +<li> F.10.2.5 The sinh functions (p: 520) </li> +</ul> +<li> C99 standard (ISO/IEC 9899:1999): </li> +<ul> +<li> 7.12.5.5 The sinh functions (p: 222) </li> +<li> 7.22 Type-generic math <tgmath.h> (p: 335-337) </li> +<li> F.9.2.5 The sinh functions (p: 457) </li> +</ul> +<li> C89/C90 standard (ISO/IEC 9899:1990): </li> +<ul><li> 4.5.3.2 The sinh function </li></ul> +</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="cosh" title="c/numeric/math/cosh"> <span class="t-lines"><span>cosh</span><span>coshf</span><span>coshl</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 cosine (\({\small\cosh{x} }\)cosh(x)) <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="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> <div><a href="asinh" title="c/numeric/math/asinh"> <span class="t-lines"><span>asinh</span><span>asinhf</span><span>asinhl</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 inverse hyperbolic sine (\({\small\operatorname{arsinh}{x} }\)arsinh(x)) <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="../complex/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 colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/numeric/math/sinh" title="cpp/numeric/math/sinh">C++ documentation</a></span> for <code>sinh</code> </td> +</tr> </table> <div class="_attribution"> + <p class="_attribution-p"> + © cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br> + <a href="https://en.cppreference.com/w/c/numeric/math/sinh" class="_attribution-link">https://en.cppreference.com/w/c/numeric/math/sinh</a> + </p> +</div> |
