std::asinh,...std::asinhl(3)
okay bestie, welcome to the std::asinh, std::asinhf, std::asinhl page from the C++ Standard Libary manual β section 3, aka std::asinh,...std::asinhl(3). we're about to make inverse hyperbolic sine make sense, and yes it's giving math but make it cute π¦β¨
β¨ NAME β¨
std::asinh,std::asinhf,std::asinhl β literally std::asinh,std::asinhf,std::asinhl - std::asinh,std::asinhf,std::asinhl. that's the name line, periodt π
π Synopsis π
bestie, the synopsis is an overload buffet, so here it is exactly, no cap:
Defined in header <cmath>
float asinh ( float num );
double asinh ( double num ); (until C++23)
long double asinh ( long double num );
/* floating-point-type */ (since C++23)
asinh ( /* floating-point-type */ num );
(constexpr since C++26)
float asinhf( float num ); (1) (2) (since C++11)
(constexpr since C++26)
long double asinhl( long double num ); (3) (since C++11)
(constexpr since C++26)
Additional overloads (since C++11)
Defined in header <cmath>
template< class Integer > (A)
(constexpr since C++26)
double asinh ( Integer num );
1-3) Computes the inverse hyperbolic sine of num.
The library provides overloads of std::asinh for all cv-unqualified floating-point types as the type of the parameter. (since C++23)
A) Additional overloads are provided for all integer types, which are (since C++11) treated as double.
πΈ Parameters πΈ
numβ floating-point or integer value
π Return value π
If no errors occur, the inverse hyperbolic sine of num (sinh-1(num), or arsinh(num)) is returned.
If a range error occurs due to underflow, the correct result (after rounding) is returned.
π Error handling π
Errors are reported as specified in math_errhandling.
If the implementation supports IEEE floating-point arithmetic (IEC 60559), then:
- if the argument is
Β±0orΒ±β, it is returned unmodified. - if the argument is
NaN,NaNis returned.
π§ Notes π§
Although the C standard (to which C++ refers for this function) names this function "arc hyperbolic sine", the inverse functions of the hyperbolic functions are the area functions. Their argument is the area of a hyperbolic sector, not an arc. The correct name is "inverse hyperbolic sine" (used by POSIX) or "area hyperbolic sine".
The additional overloads are not required to be provided exactly as (A). They only need to be sufficient to ensure that for their argument num of integer type, std::asinh(num) has the same effect as std::asinh(static_cast<double>(num)).
π Examples π
run this code, bestie:
// Run this code
#include <cmath>
#include <iostream>
int main()
{
std::cout << "asinh(1) = " << std::asinh(1) << '\n'
<< "asinh(-1) = " << std::asinh(-1) << '\n';
// special values
std::cout << "asinh(+0) = " << std::asinh(+0.0) << '\n'
<< "asinh(-0) = " << std::asinh(-0.0) << '\n';
}
β¨ Output β¨
asinh(1) = 0.881374
asinh(-1) = -0.881374
asinh(+0) = 0
asinh(-0) = -0
π See also π
acosh,acoshf,acoshlβ(C++11)(C++11)(C++11)computes the inverse hyperbolic cosine (\({\small\operatorname{arcosh}{x}}\)arcosh(x)) (function) πatanh,atanhf,atanhlβ(C++11)(C++11)(C++11)computes the inverse hyperbolic tangent (\({\small\operatorname{artanh}{x}}\)artanh(x)) (function) πsinh,sinhf,sinhlβsinhfandsinhlare(C++11)(C++11); computes hyperbolic sine (\({\small\sinh{x}}\)sinh(x)) (function) πasinh(std::complex)β(C++11)computes area hyperbolic sine of a complex number (\({\small\operatorname{arsinh}{z}}\)arsinh(z)) (function template) π- C documentation for
asinhβ yes, the C docs are right there too
π External links π
Weisstein, Eric W. "Inverse Hyperbolic Sine." From MathWorld β A Wolfram Web Resource.
and that's the whole std::asinh,...std::asinhl(3) situation, bestie π«Ά β source/version/date core: http://cppreference.com, 2024.06.10, page std::asinh,...std::asinhl(3). byeee, go compute some inverse hyperbolic sine πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms