diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | math/gen-tgmath-tests.py | 4 | ||||
-rw-r--r-- | math/tgmath.h | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,9 @@ 2017-06-28 Joseph Myers <joseph@codesourcery.com> + * math/tgmath.h [__USE_GNU] (log10): Use clog10 not __clog10. + * math/gen-tgmath-tests.py (Tests.add_all_tests): Test log10 for + complex arguments. + [BZ #21687] * math/tgmath.h (__TGMATH_BINARY_REAL_RET_ONLY): New macro. (totalorder): Use it. diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py index db6553e..31a3bd2 100755 --- a/math/gen-tgmath-tests.py +++ b/math/gen-tgmath-tests.py @@ -497,7 +497,9 @@ class Tests(object): self.add_tests('lgamma', 'r', ['r']) self.add_tests('llrint', 'long long int', ['r']) self.add_tests('llround', 'long long int', ['r']) - self.add_tests('log10', 'r', ['r']) + # log10 is real-only in ISO C, but supports complex arguments + # as a GNU extension. + self.add_tests('log10', 'g', ['g']) self.add_tests('log1p', 'r', ['r']) self.add_tests('log2', 'r', ['r']) self.add_tests('logb', 'r', ['r']) diff --git a/math/tgmath.h b/math/tgmath.h index a0da104..7afe41e 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -319,7 +319,7 @@ /* Base-ten logarithm of X. */ #ifdef __USE_GNU -# define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, __clog10) +# define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, clog10) #else # define log10(Val) __TGMATH_UNARY_REAL_ONLY (Val, log10) #endif |