complex.cc (pow): Remove definitions for explicit specializations.

* src/complex.cc (pow): Remove definitions for explicit
	specializations.
	* libmath/mathconf.h: Remove declarations for c_log, c_logf,
	c_logl.
	* libmath/complex-stub.h: Remove declarations for cpow, cpowf,
	cpowl.
	* libmath/cpow.c: Remove.
	* libmath/cpowf.c: Remove.
	* libmath/cpowl.c: Remove.
	* libmath/Makefile.am (EXTRA_LONG_DOUBLE_yes): Remove c_logl,
	cpowl,
	(EXTRA_DIST): Remove c_log, c_logf, carg, cargf.
	* libmath/Makefile.in: Regenarate.
	* libmath/c_log.c: Remove
	* libmath/c_logf.c: Likewise.
	* libmath/c_logl.c: Likewise.
	* libmath/carg.c: Likewise.
	* libmath/cargf.c: Likewise.
	* libmath/cargl.c: Likewise.
	* include/bits/std_complex.h (pow): Define primary templates.
	(complex<>): Remove friend declarations for pow<>().
	* acinclude.m4: Remove check for c_log, c_logf, c_logl, carg,
	cargf.
	* aclocal.m4: Regenarate.
	* configure: Regenarate.

From-SVN: r38025
This commit is contained in:
Gabriel Dos Reis 2000-12-05 04:01:46 +00:00 committed by Gabriel Dos Reis
parent 9d86bffccb
commit fad3e66e8e
19 changed files with 72 additions and 505 deletions

View File

@ -1,3 +1,31 @@
2000-12-05 Gabriel Dos Reis <gdr@codesourcery.com>
* src/complex.cc (pow): Remove definitions for explicit
specializations.
* libmath/mathconf.h: Remove declarations for c_log, c_logf,
c_logl.
* libmath/complex-stub.h: Remove declarations for cpow, cpowf,
cpowl.
* libmath/cpow.c: Remove.
* libmath/cpowf.c: Remove.
* libmath/cpowl.c: Remove.
* libmath/Makefile.am (EXTRA_LONG_DOUBLE_yes): Remove c_logl,
cpowl,
(EXTRA_DIST): Remove c_log, c_logf, carg, cargf.
* libmath/Makefile.in: Regenarate.
* libmath/c_log.c: Remove
* libmath/c_logf.c: Likewise.
* libmath/c_logl.c: Likewise.
* libmath/carg.c: Likewise.
* libmath/cargf.c: Likewise.
* libmath/cargl.c: Likewise.
* include/bits/std_complex.h (pow): Define primary templates.
(complex<>): Remove friend declarations for pow<>().
* acinclude.m4: Remove check for c_log, c_logf, c_logl, carg,
cargf.
* aclocal.m4: Regenarate.
* configure: Regenarate.
2000-12-03 Joseph S. Myers <jsm28@cam.ac.uk>
* docs/configopts.html, docs/documentation.html,

View File

@ -743,8 +743,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
AC_CHECK_HEADERS([complex.h])
AC_CHECK_LIB(m, main)
AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf \
c_log c_logf clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf carg cargf nan hypot hypotf atan2f expf \
csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf nan hypot hypotf atan2f expf \
copysignf)
dnl Compile the long double complex functions only if the function
@ -756,7 +756,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
&& test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l)
csqrtl ctanhl ctanl hypotl signbitl clog10l)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)

View File

@ -755,8 +755,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
AC_CHECK_HEADERS([complex.h])
AC_CHECK_LIB(m, main)
AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf \
c_log c_logf clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf carg cargf nan hypot hypotf atan2f expf \
csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf nan hypot hypotf atan2f expf \
copysignf)
dnl Compile the long double complex functions only if the function
@ -768,7 +768,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
&& test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l)
csqrtl ctanhl ctanl hypotl signbitl clog10l)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)

View File

@ -17075,8 +17075,8 @@ else
fi
for ac_func in ccos ccosf ccosh ccoshf cexp cexpf \
c_log c_logf clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf carg cargf nan hypot hypotf atan2f expf \
csin csinf csinh csinhf csqrt \
csqrtf ctan ctanf ctanh ctanhf nan hypot hypotf atan2f expf \
copysignf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
@ -17140,7 +17140,7 @@ done
&& test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
for ac_func in ccoshl ccosl cexpl cpowl csinhl csinl \
csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l
csqrtl ctanhl ctanl hypotl signbitl clog10l
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:17147: checking for $ac_func" >&5

View File

@ -450,6 +450,34 @@ namespace std
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
}
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __z, int __n)
{
return __pow_helper(__z, __n);
}
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __x, const _Tp& __y)
{
return exp(__y * log(__x));
}
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{
return exp(__x * log(__x));
}
template<typename _Tp>
inline complex<_Tp>
pow(const _Tp& __x, const complex<_Tp>& __y)
{
return exp(__y * log(__x));
}
// 26.2.3 complex specializations
// complex<float> specialization
template<> class complex<float>
@ -496,11 +524,6 @@ namespace std
friend class complex<double>;
friend class complex<long double>;
friend complex<float> pow<>(const complex<float>&, int);
friend complex<float> pow<>(const complex<float>&, const float&);
friend complex<float> pow<>(const complex<float>&,
const complex<float>&);
friend complex<float> pow<>(const float&, const complex<float>&);
friend complex<float> sqrt<>(const complex<float>&);
friend complex<float> tan<>(const complex<float>&);
friend complex<float> tanh<>(const complex<float>&);
@ -651,11 +674,6 @@ namespace std
friend class complex<float>;
friend class complex<long double>;
friend complex<double> pow<>(const complex<double>&, int);
friend complex<double> pow<>(const complex<double>&, const double&);
friend complex<double> pow<>(const complex<double>&,
const complex<double>&);
friend complex<double> pow<>(const double&, const complex<double>&);
friend complex<double> sqrt<>(const complex<double>&);
friend complex<double> tan<>(const complex<double>&);
friend complex<double> tanh<>(const complex<double>&);
@ -806,13 +824,6 @@ namespace std
friend class complex<float>;
friend class complex<double>;
friend complex<long double> pow<>(const complex<long double>&, int);
friend complex<long double> pow<>(const complex<long double>&,
const long double&);
friend complex<long double> pow<>(const complex<long double>&,
const complex<long double>&);
friend complex<long double> pow<>(const long double&,
const complex<long double>&);
friend complex<long double> sqrt<>(const complex<long double>&);
friend complex<long double> tan<>(const complex<long double>&);
friend complex<long double> tanh<>(const complex<long double>&);
@ -951,8 +962,3 @@ namespace std
} // namespace std
#endif /* _CPP_COMPLEX */

View File

@ -26,16 +26,16 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
noinst_LTLIBRARIES = libmath.la
EXTRA_LONG_DOUBLE_yes = \
ccosl.c cexpl.c c_logl.c clog10l.c cpowl.c csinhl.c \
csqrtl.c ctanhl.c ctanl.c cargl.c hypotl.c \
ccosl.c cexpl.c clog10l.c csinhl.c \
csqrtl.c ctanhl.c ctanl.c hypotl.c \
signbitl.c
EXTRA_DIST = \
ccos.c ccosf.c ccosh.c ccoshf.c ccoshl.c \
cexp.c cexpf.c c_log.c c_logf.c clog10.c clog10f.c \
cpow.c cpowf.c csin.c csinf.c csinh.c csinhf.c \
cexp.c cexpf.c clog10.c clog10f.c \
csin.c csinf.c csinh.c csinhf.c \
csinl.c csqrt.c csqrtf.c ctan.c ctanf.c ctanh.c \
ctanhf.c carg.c cargf.c hypot.c hypotf.c\
ctanhf.c hypot.c hypotf.c\
atan2f.c expf.c \
$(EXTRA_LONG_DOUBLE_yes)
@ -63,11 +63,3 @@ INCLUDES = \
-I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include \
$(TOPLEVEL_INCLUDES)

View File

@ -113,10 +113,10 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
noinst_LTLIBRARIES = libmath.la
EXTRA_LONG_DOUBLE_yes = ccosl.c cexpl.c c_logl.c clog10l.c cpowl.c csinhl.c csqrtl.c ctanhl.c ctanl.c cargl.c hypotl.c signbitl.c
EXTRA_LONG_DOUBLE_yes = ccosl.c cexpl.c clog10l.c csinhl.c csqrtl.c ctanhl.c ctanl.c hypotl.c signbitl.c
EXTRA_DIST = ccos.c ccosf.c ccosh.c ccoshf.c ccoshl.c cexp.c cexpf.c c_log.c c_logf.c clog10.c clog10f.c cpow.c cpowf.c csin.c csinf.c csinh.c csinhf.c csinl.c csqrt.c csqrtf.c ctan.c ctanf.c ctanh.c ctanhf.c carg.c cargf.c hypot.c hypotf.c atan2f.c expf.c $(EXTRA_LONG_DOUBLE_yes)
EXTRA_DIST = ccos.c ccosf.c ccosh.c ccoshf.c ccoshl.c cexp.c cexpf.c clog10.c clog10f.c csin.c csinf.c csinh.c csinhf.c csinl.c csqrt.c csqrtf.c ctan.c ctanf.c ctanh.c ctanhf.c hypot.c hypotf.c atan2f.c expf.c $(EXTRA_LONG_DOUBLE_yes)
libmath_la_LIBADD = @LIBMATHOBJS@ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))

View File

@ -1,63 +0,0 @@
/* Compute complex natural logarithm. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
__complex__ double
c_log (__complex__ double x)
{
__complex__ double result;
if (x == 0.0)
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
__imag__ result = copysign (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabs (__real__ x);
}
else if (__real__ x == __real__ x && __imag__ x == __imag__ x)
{
/* Neither real nor imaginary part is NaN. */
__real__ result = log (hypot (__real__ x, __imag__ x));
__imag__ result = atan2 (__imag__ x, __real__ x);
}
else
{
__imag__ result = NAN;
if (INFINITE_P (__real__ x) || INFINITE_P (__imag__ x))
/* Real or imaginary part is infinite. */
__real__ result = HUGE_VAL;
else
__real__ result = NAN;
}
return result;
}

View File

@ -1,64 +0,0 @@
/* Compute complex natural logarithm. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
__complex__ float
c_logf (__complex__ float x)
{
__complex__ float result;
if (x == 0.0)
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
__imag__ result = copysignf (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsf (__real__ x);
}
else if (__real__ x == __real__ x && __imag__ x == __imag__ x)
{
/* Neither real nor imaginary part is NaN. */
__real__ result = logf (hypotf (__real__ x, __imag__ x));
__imag__ result = atan2f (__imag__ x, __real__ x);
}
else
{
__imag__ result = NAN;
if (INFINITEF_P (__real__ x) || INFINITEF_P (__imag__ x))
/* Real or imaginary part is infinite. */
__real__ result = HUGE_VALF;
else
__real__ result = NAN;
}
return result;
}

View File

@ -1,75 +0,0 @@
/* Compute complex natural logarithm. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <math.h>
#include "mathconf.h"
#ifndef M_PIl
#define M_PIl M_PI
#endif
/* Thanks to SGI we have to trick here. At least Irix 6.2 provides hypotl,
but it has a wrong prototype. Grrr. */
extern long double local_hypotl (long double, long double) asm ("hypotl");
__complex__ long double
c_logl (__complex__ long double x)
{
__complex__ long double result;
if (x == 0.0)
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
__imag__ result = copysignl (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
}
else if (__real__ x == __real__ x && __imag__ x == __imag__ x)
{
/* Neither real nor imaginary part is NaN. */
__real__ result = logl (local_hypotl (__real__ x, __imag__ x));
__imag__ result = atan2l (__imag__ x, __real__ x);
}
else
{
__imag__ result = NAN;
if (INFINITEL_P (__real__ x) || INFINITEL_P (__imag__ x))
/* Real or imaginary part is infinite. */
__real__ result = HUGE_VALL;
else
__real__ result = NAN;
}
return result;
}

View File

@ -1,37 +0,0 @@
/* Compute argument of complex double value. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
double
carg (__complex__ double x)
{
return atan2 (__imag__ x, __real__ x);
}

View File

@ -1,38 +0,0 @@
/* Compute argument of complex float value. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
float
cargf (__complex__ float x)
{
return atan2f (__imag__ x, __real__ x);
}

View File

@ -1,38 +0,0 @@
/* Compute argument of complex long double value. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
long double
cargl (__complex__ long double x)
{
return atan2l (__imag__ x, __real__ x);
}

View File

@ -50,10 +50,6 @@ __complex__ double clog10 (__complex__ double x);
__complex__ float clog10f (__complex__ float x);
__complex__ long double clog10l (__complex__ long double x);
__complex__ double cpow (__complex__ double x, __complex__ double c);
__complex__ float cpowf (__complex__ float x, __complex__ float c);
__complex__ long double cpowl (__complex__ long double x, __complex__ long double c);
__complex__ double csin (__complex__ double x);
__complex__ float csinf (__complex__ float x);
__complex__ long double csinl (__complex__ long double x);

View File

@ -1,39 +0,0 @@
/* Complex power of double values. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
__complex__ double
cpow (__complex__ double x, __complex__ double c)
{
return cexp (c * c_log (x));
}

View File

@ -1,38 +0,0 @@
/* Complex power of float values. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
__complex__ float
cpowf (__complex__ float x, __complex__ float c)
{
return cexpf (c * c_logf (x));
}

View File

@ -1,40 +0,0 @@
/* Complex power of long double values. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this library; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile
this file and link it with other files to produce an executable, this
file does not by itself cause the resulting executable to be covered by
the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
#include <math.h>
#include "mathconf.h"
__complex__ long double
cpowl (__complex__ long double x, __complex__ long double c)
{
return cexpl (c * c_logl (x));
}

View File

@ -232,9 +232,6 @@ extern "C" {
#else
# include "complex-stub.h"
#endif
__complex__ double c_log (__complex__ double x);
__complex__ float c_logf (__complex__ float x);
__complex__ long double c_logl (__complex__ long double x);
/* signbit is a macro in ISO C99. */
#ifndef signbit

View File

@ -44,26 +44,6 @@
namespace std
{
template<>
complex<FLT>
pow(const complex<FLT>& __x, int __n)
{ return complex<FLT>(cexp(__n * c_log(__x._M_value))); }
template<>
complex<FLT>
pow(const complex<FLT>& __x, const FLT& __y)
{ return complex<FLT>(cexp(__y * c_log(__x._M_value))); }
template<>
complex<FLT>
pow(const complex<FLT>& __x, const complex<FLT>& __y)
{ return complex<FLT>(cpow(__x._M_value, __y._M_value)); }
template<>
complex<FLT>
pow(const FLT& __x, const complex<FLT>& __y)
{ return complex<FLT>(cexp(__y._M_value * log(__x))); }
template<>
complex<FLT>
sqrt(const complex<FLT>& __x)