sinh(), sinhf(), sinhl()

Compute the hyperbolic sine

Synopsis:

#include <math.h>

double sinh( double x );

float sinhf( float x );

long double asinhl( long double x );

Arguments:

x
The angle, in radians, for which you want to compute the hyperbolic sine.

Library:

libm

Use the -l m option to qcc to link against this library.

Description:

These functions compute the hyperbolic sine of x radians. A range error occurs if the magnitude of x is too large.

To check for error situations, use feclearexcept() and fetestexcept():

Returns:

The hyperbolic sine value.

If the result would cause an overflow, a range error occurs, and the functions return ±HUGE_VAL, ±HUGE_VALF, and ±HUGE_VALL (with the same sign as x), as appropriate for the type of the function.

If x is NaN, NaN is returned. If x is ±0 or ±Inf, x is returned. If x is subnormal, a range error may occur and x is returned.

Errors:

FE_OVERFLOW
The result would cause an overflow.
FE_UNDERFLOW
The value of x is subnormal.

Examples:

#include <stdio.h>
#include <math.h>
#include <fenv.h>
#include <stdlib.h>

int main( void )
{
    int except_flags;

    feclearexcept(FE_ALL_EXCEPT);

    printf( "%f\n", sinh(.5) );

    except_flags = fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW);
    if(except_flags) {
        /* An error occurred; handle it appropriately. */
    }

    return EXIT_SUCCESS;
}

produces the output:

0.521095

Classification:

ANSI, POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes