Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

d
asinh
math
communitycreator

What is the asinh() function in D?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

The asinh() function returns the inverse hyperbolic sine of a number.

The figure below shows the mathematical representation of the asinh() function.

Mathematical representation of the inverse hyperbolic sine function

Note: std.math is 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 function
import std.math;
int main() {
//positive number
writeln("The value of asinh(0.5): ",asinh(0.5) );
// negative number
writeln("The value of asinh(-0.5): ",asinh(-0.5));
//zero
writeln("The value of asinh(0.0): ",asinh(0.0) );
return 0;
}

Explanation

  • Line 4: We add the std.math header required for asinh() 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().

RELATED TAGS

d
asinh
math
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring