What is the asinh() function in D?
Overview
The asinh() function returns the inverse hyperbolic sine of a number.
The figure below shows the mathematical representation of the asinh() function.
Note:
std.mathis required for this function.
Syntax
//number can be real, float, or double.
asinh(number)
Parameters
This function requires a number as a parameter.
Return value
asinh() returns the inverse hyperbolic sine of the number sent as a parameter.
Example
The code below demonstrates how to use the asinh() function in D.
import core.stdc.stdio;import std.stdio;//header required for functionimport std.math;int main() {//positive numberwriteln("The value of asinh(0.5): ",asinh(0.5) );// negative numberwriteln("The value of asinh(-0.5): ",asinh(-0.5));//zerowriteln("The value of asinh(0.0): ",asinh(0.0) );return 0;}
Explanation
- Line 4: We add the
std.mathheader required forasinh()function. - Line 8: We calculate the inverse hyperbolic sine of the positive number using
asinh(). - Line 11: We calculate the inverse hyperbolic sine of the negative number using
asinh().
- Line 14: We calculate the inverse hyperbolic sine of zero using
asinh().