Skip to content

Commit a837265

Browse files
committed
adding comments
1 parent c792237 commit a837265

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/c/log.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ long double _Complex clog1pl(long double _Complex z)
4040
}
4141

4242

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+
*/
4350
double _Complex pos_clog(double _Complex z)
4451
{
4552
const double rz = creal(z);
@@ -55,6 +62,13 @@ double _Complex pos_clog(double _Complex z)
5562
}
5663

5764

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+
*/
5872
long double _Complex pos_clogl(long double _Complex z)
5973
{
6074
const long double rz = creall(z);

src/c/log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ double _Complex clog1p(double _Complex z);
1212
/** returns clog(1 + z) with long double precision */
1313
long double _Complex clog1pl(long double _Complex z);
1414

15-
/** returns clog(z) with double precision, treating -0.0 correctly */
15+
/** returns clog(z) with double precision */
1616
double _Complex pos_clog(double _Complex z);
1717

18-
/** returns clog(z) with long double precision, treating -0.0L correctly */
18+
/** returns clog(z) with long double precision */
1919
long double _Complex pos_clogl(long double _Complex z);

src/cpp/log.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace polylogarithm {
1313

1414

15+
/// returns log(1 + z) for complex z
1516
template <typename T>
1617
std::complex<T> log1p(const std::complex<T>& z) noexcept
1718
{
@@ -27,6 +28,13 @@ std::complex<T> log1p(const std::complex<T>& z) noexcept
2728
}
2829

2930

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+
*/
3038
template <typename T>
3139
std::complex<T> pos_log(const std::complex<T>& z) noexcept
3240
{

0 commit comments

Comments
 (0)