289 lines
7.7 KiB
Markdown
289 lines
7.7 KiB
Markdown
[complex.transcendentals]
|
|
|
|
# 29 Numerics library [[numerics]](./#numerics)
|
|
|
|
## 29.4 Complex numbers [[complex.numbers]](complex.numbers#complex.transcendentals)
|
|
|
|
### 29.4.8 Transcendentals [complex.transcendentals]
|
|
|
|
[ð](#lib:acos,complex)
|
|
|
|
`template<class T> constexpr complex<T> acos(const complex<T>& x);
|
|
`
|
|
|
|
[1](#1)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L878)
|
|
|
|
*Returns*: The complex arc cosine of x[.](#1.sentence-1)
|
|
|
|
[2](#2)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L882)
|
|
|
|
*Remarks*: Behaves the same as the C function cacos[.](#2.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.5.1
|
|
|
|
[ð](#lib:asin,complex)
|
|
|
|
`template<class T> constexpr complex<T> asin(const complex<T>& x);
|
|
`
|
|
|
|
[3](#3)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L895)
|
|
|
|
*Returns*: The complex arc sine of x[.](#3.sentence-1)
|
|
|
|
[4](#4)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L899)
|
|
|
|
*Remarks*: Behaves the same as the C function casin[.](#4.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.5.2
|
|
|
|
[ð](#lib:atan,complex)
|
|
|
|
`template<class T> constexpr complex<T> atan(const complex<T>& x);
|
|
`
|
|
|
|
[5](#5)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L912)
|
|
|
|
*Returns*: The complex arc tangent of x[.](#5.sentence-1)
|
|
|
|
[6](#6)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L916)
|
|
|
|
*Remarks*: Behaves the same as the C function catan[.](#6.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.5.3
|
|
|
|
[ð](#lib:acosh,complex)
|
|
|
|
`template<class T> constexpr complex<T> acosh(const complex<T>& x);
|
|
`
|
|
|
|
[7](#7)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L929)
|
|
|
|
*Returns*: The complex arc hyperbolic cosine of x[.](#7.sentence-1)
|
|
|
|
[8](#8)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L933)
|
|
|
|
*Remarks*: Behaves the same as the C function cacosh[.](#8.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.6.1
|
|
|
|
[ð](#lib:asinh,complex)
|
|
|
|
`template<class T> constexpr complex<T> asinh(const complex<T>& x);
|
|
`
|
|
|
|
[9](#9)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L946)
|
|
|
|
*Returns*: The complex arc hyperbolic sine of x[.](#9.sentence-1)
|
|
|
|
[10](#10)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L950)
|
|
|
|
*Remarks*: Behaves the same as the C function casinh[.](#10.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.6.2
|
|
|
|
[ð](#lib:atanh,complex)
|
|
|
|
`template<class T> constexpr complex<T> atanh(const complex<T>& x);
|
|
`
|
|
|
|
[11](#11)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L963)
|
|
|
|
*Returns*: The complex arc hyperbolic tangent of x[.](#11.sentence-1)
|
|
|
|
[12](#12)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L967)
|
|
|
|
*Remarks*: Behaves the same as the C function catanh[.](#12.sentence-1)
|
|
|
|
See also: ISO/IEC 9899:2024, 7.3.6.3
|
|
|
|
[ð](#lib:cos,complex)
|
|
|
|
`template<class T> constexpr complex<T> cos(const complex<T>& x);
|
|
`
|
|
|
|
[13](#13)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L979)
|
|
|
|
*Returns*: The complex cosine of x[.](#13.sentence-1)
|
|
|
|
[ð](#lib:cosh,complex)
|
|
|
|
`template<class T> constexpr complex<T> cosh(const complex<T>& x);
|
|
`
|
|
|
|
[14](#14)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L990)
|
|
|
|
*Returns*: The complex hyperbolic cosine of x[.](#14.sentence-1)
|
|
|
|
[ð](#lib:exp,complex)
|
|
|
|
`template<class T> constexpr complex<T> exp(const complex<T>& x);
|
|
`
|
|
|
|
[15](#15)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1001)
|
|
|
|
*Returns*: The complex base-e exponential of x[.](#15.sentence-1)
|
|
|
|
[ð](#lib:log,complex)
|
|
|
|
`template<class T> constexpr complex<T> log(const complex<T>& x);
|
|
`
|
|
|
|
[16](#16)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1012)
|
|
|
|
*Returns*: The complex natural (base-e) logarithm of x[.](#16.sentence-1)
|
|
|
|
For all x,imag(log(x)) lies in the interval [âÏ, Ï][.](#16.sentence-2)
|
|
|
|
[*Note [1](#note-1)*:
|
|
|
|
The semantics of this function are intended to be the same in C++
|
|
as they are for clog in C[.](#16.sentence-3)
|
|
|
|
â *end note*]
|
|
|
|
[17](#17)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1021)
|
|
|
|
*Remarks*: The branch cuts are along the negative real axis[.](#17.sentence-1)
|
|
|
|
[ð](#lib:log10,complex)
|
|
|
|
`template<class T> constexpr complex<T> log10(const complex<T>& x);
|
|
`
|
|
|
|
[18](#18)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1032)
|
|
|
|
*Returns*: The complex common (base-10) logarithm of x, defined aslog(x) / log(10)[.](#18.sentence-1)
|
|
|
|
[19](#19)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1037)
|
|
|
|
*Remarks*: The branch cuts are along the negative real axis[.](#19.sentence-1)
|
|
|
|
[ð](#lib:pow,complex)
|
|
|
|
`template<class T> constexpr complex<T> pow(const complex<T>& x, const complex<T>& y);
|
|
template<class T> constexpr complex<T> pow(const complex<T>& x, const T& y);
|
|
template<class T> constexpr complex<T> pow(const T& x, const complex<T>& y);
|
|
`
|
|
|
|
[20](#20)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1050)
|
|
|
|
*Returns*: The complex power of base x raised to the yth power,
|
|
defined asexp(y * log(x))[.](#20.sentence-1)
|
|
|
|
The value returned forpow(0, 0) is implementation-defined[.](#20.sentence-2)
|
|
|
|
[21](#21)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1059)
|
|
|
|
*Remarks*: The branch cuts are along the negative real axis[.](#21.sentence-1)
|
|
|
|
[ð](#lib:sin,complex)
|
|
|
|
`template<class T> constexpr complex<T> sin(const complex<T>& x);
|
|
`
|
|
|
|
[22](#22)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1070)
|
|
|
|
*Returns*: The complex sine of x[.](#22.sentence-1)
|
|
|
|
[ð](#lib:sinh,complex)
|
|
|
|
`template<class T> constexpr complex<T> sinh(const complex<T>& x);
|
|
`
|
|
|
|
[23](#23)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1081)
|
|
|
|
*Returns*: The complex hyperbolic sine of x[.](#23.sentence-1)
|
|
|
|
[ð](#lib:sqrt,complex)
|
|
|
|
`template<class T> constexpr complex<T> sqrt(const complex<T>& x);
|
|
`
|
|
|
|
[24](#24)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1092)
|
|
|
|
*Returns*: The complex square root of x, in the range of the right
|
|
half-plane[.](#24.sentence-1)
|
|
|
|
[*Note [2](#note-2)*:
|
|
|
|
The semantics of this function are intended to be the same in C++
|
|
as they are for csqrt in C[.](#24.sentence-2)
|
|
|
|
â *end note*]
|
|
|
|
[25](#25)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1101)
|
|
|
|
*Remarks*: The branch cuts are along the negative real axis[.](#25.sentence-1)
|
|
|
|
[ð](#lib:tan,complex)
|
|
|
|
`template<class T> constexpr complex<T> tan(const complex<T>& x);
|
|
`
|
|
|
|
[26](#26)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1112)
|
|
|
|
*Returns*: The complex tangent of x[.](#26.sentence-1)
|
|
|
|
[ð](#lib:tanh,complex)
|
|
|
|
`template<class T> constexpr complex<T> tanh(const complex<T>& x);
|
|
`
|
|
|
|
[27](#27)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1123)
|
|
|
|
*Returns*: The complex hyperbolic tangent of x[.](#27.sentence-1)
|