File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ long double _Complex clog1pl(long double _Complex z)
40
40
}
41
41
42
42
43
+ /**
44
+ * returns log(z) for complex z
45
+ * @param z complex argument
46
+ * @note Points on the branch cut are treated differently from std::log(z):
47
+ * Points with Re(z) < 0 and Im(z) == -0.0 are mapped to Im(z) == 0.0
48
+ * @return log(z)
49
+ */
43
50
double _Complex pos_clog (double _Complex z )
44
51
{
45
52
const double rz = creal (z );
@@ -55,6 +62,13 @@ double _Complex pos_clog(double _Complex z)
55
62
}
56
63
57
64
65
+ /**
66
+ * returns log(z) for complex z
67
+ * @param z complex argument
68
+ * @note Points on the branch cut are treated differently from std::log(z):
69
+ * Points with Re(z) < 0 and Im(z) == -0.0 are mapped to Im(z) == 0.0
70
+ * @return log(z)
71
+ */
58
72
long double _Complex pos_clogl (long double _Complex z )
59
73
{
60
74
const long double rz = creall (z );
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ double _Complex clog1p(double _Complex z);
12
12
/** returns clog(1 + z) with long double precision */
13
13
long double _Complex clog1pl (long double _Complex z );
14
14
15
- /** returns clog(z) with double precision, treating -0.0 correctly */
15
+ /** returns clog(z) with double precision */
16
16
double _Complex pos_clog (double _Complex z );
17
17
18
- /** returns clog(z) with long double precision, treating -0.0L correctly */
18
+ /** returns clog(z) with long double precision */
19
19
long double _Complex pos_clogl (long double _Complex z );
Original file line number Diff line number Diff line change 12
12
namespace polylogarithm {
13
13
14
14
15
+ // / returns log(1 + z) for complex z
15
16
template <typename T>
16
17
std::complex<T> log1p (const std::complex<T>& z) noexcept
17
18
{
@@ -27,6 +28,13 @@ std::complex<T> log1p(const std::complex<T>& z) noexcept
27
28
}
28
29
29
30
31
+ /* *
32
+ * returns log(z) for complex z
33
+ * @param z complex argument
34
+ * @note Points on the branch cut are treated differently from std::log(z):
35
+ * Points with Re(z) < 0 and Im(z) == -0.0 are mapped to Im(z) == 0.0
36
+ * @return log(z)
37
+ */
30
38
template <typename T>
31
39
std::complex<T> pos_log (const std::complex<T>& z) noexcept
32
40
{
You can’t perform that action at this time.
0 commit comments