Home » C++ programming language

asinh() function with example in C++

C++ asinh() function: Here, we are going to learn about the asinh() function with example of cmath header in C++ programming language?
Submitted by IncludeHelp, on April 28, 2019

C++ asinh() function

asinh() function is a library function of cmath header, it is used to find the area hyperbolic sine of the given value, it accepts a number (x) and returns the area hyperbolic sine of x.

Syntax of asinh() function:

    asinh(x);

Parameter(s): x – is the number/value whose area hyperbolic sine is calculated.

Return value: double – it returns double type value that is the area hyperbolic sine of the given number/value x.

Example:

    Input:
    float x = 2.45;
    
    Function call:
    asinh(x);    
    
    Output:
    1.6285

C++ code to demonstrate the example of asinh() function

// C++ code to demonstrate the example of 
// asinh() function

#include <iostream>
#include <cmath>
using namespace std;

// main() section
int main()
{
    float x;
    
    x = 1.0;
    cout<<"asinh("<<x<<"): "<<asinh(x)<<endl;

    x = 10.23;
    cout<<"asinh("<<x<<"): "<<asinh(x)<<endl;    

    x = 2.45;
    cout<<"asinh("<<x<<"): "<<asinh(x)<<endl;    
    
    return 0;
}

Output

asinh(1): 0.881374
asinh(10.23): 3.02085
asinh(2.45): 1.6285

Reference: C++ asinh() function




Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.