Namespaces
Variants
Views
Actions

asinh

From cppreference.com
< c‎ | numeric‎ | math
 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
Trigonometric and hyperbolic functions
asinh
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Nearest integer floating point operations
(C99)(C99)(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
Macro constants
 
Defined in header <math.h>
float       asinhf( float arg );
(since C99)
double      asinh( double arg );
(since C99)
long double asinhl( long double arg );
(since C99)

Computes area hyperbolic sine of arg

Contents

[edit] Parameters

arg - floating point value

[edit] Return value

Inverse hyperbolic sine of arg

[edit] Example

#include <stdio.h>
#include <math.h>
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <string.h>
 
#pragma STDC FENV_ACCESS ON
 
void show_fe_exceptions(void)
{
    printf("current exceptions raised: ");
    if(fetestexcept(FE_DIVBYZERO))     printf(" FE_DIVBYZERO");
    if(fetestexcept(FE_INEXACT))       printf(" FE_INEXACT");
    if(fetestexcept(FE_INVALID))       printf(" FE_INVALID");
    if(fetestexcept(FE_OVERFLOW))      printf(" FE_OVERFLOW");
    if(fetestexcept(FE_UNDERFLOW))     printf(" FE_UNDERFLOW");
    if(fetestexcept(FE_ALL_EXCEPT)==0) printf(" none");
    printf("\n");
}
 
int main(void)
{
    printf("asinh(0.521095)  = %f\n",    asinh(0.521095));
    printf("sinh(0.5)        = %f\n",    sinh(0.5));         /* inverse of asinh */
    printf("asinh(+0.0)      = %+.1f\n", asinh(+0.0));
    printf("asinh(-0.0)      = %+.1f\n", asinh(-0.0));
    printf("asinh(+INFINITY) = %+.1f\n", asinh(+INFINITY));
    printf("asinh(-INFINITY) = %+.1f\n", asinh(-INFINITY));
    printf("asinh(NAN)       = %f\n",    asinh(NAN));
    printf("\n");
 
    /* "inexact" floating-point exception */
    errno = 0; feclearexcept(FE_ALL_EXCEPT);
    printf("asinh(DBL_MAX)   = %f\n",   asinh(DBL_MAX));
    printf("%s\n",strerror(errno));
    show_fe_exceptions();
 
    return 0;
}

Possible output:

asinh(0.521095)  = 0.500000
sinh(0.5)        = 0.521095
asinh(+0.0)      = +0.0
asinh(-0.0)      = -0.0
asinh(+INFINITY) = +inf
asinh(-INFINITY) = -inf
asinh(NAN)       = nan
 
asinh(DBL_MAX)   = 710.475860
Success
current exceptions raised:  FE_INEXACT

[edit] See also

(C99)
area hyperbolic cosine
(function) [edit]
(C99)
area hyperbolic tangent
(function) [edit]
computes hyperbolic sine (sh(x))
(function) [edit]

[edit] External links

Weisstein, Eric W. "Inverse Hyperbolic Sine." From MathWorld--A Wolfram Web Resource.