Commit 1228c7b6 by Gabriel Dos Reis Committed by Gabriel Dos Reis

Makefile.am (sources): Remove complex.cc, complexf.cc and complexl.cc from list.

	* src/Makefile.am (sources): Remove complex.cc, complexf.cc and
	complexl.cc from list.
	* src/Makefile.in: Regenerate.
	* src/complex.cc: Remove.
	* src/complexf.cc: Likewise.
	* src/complexl.cc: Likewise.

	* libmath/Makefile.am (EXTRA_LONG_DOUBLE_yes): Remove csqrtl.c
	(EXTRA_DIST): Remove csqrt.c and csqrtf.c.
	* libmath/Makefile.in: Regenerate.
	* libmath/complex-stub.h: Remove.
	* libmath/csqrt.c: Likewise.
	* libmath/sqrtf.c: Likewise.
	* libmath/sqrtl.c: Likewise.
	* libmath/mathconf.h: Remove <complex.h> and "complex-stub.h"
	#inclusion.

	* include/bits/std_complex.h (sqrt<>): Define primary template.
	(complex<>): Remove sqrt friend declarations.

	* configure.in: Initialize with src/ios.cc.
	* configure: Regenerate.
	* acinclude.m4: Remove check for csqrt* and <complex.h>
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* Makefile.in: Regenerate.

From-SVN: r38409
parent 4b01bd16
2000-12-21 Gabriel Dos Reis <gdr@codesourcery.com>
* src/Makefile.am (sources): Remove complex.cc, complexf.cc and
complexl.cc from list.
* src/Makefile.in: Regenerate.
* src/complex.cc: Remove.
* src/complexf.cc: Likewise.
* src/complexl.cc: Likewise.
* libmath/Makefile.am (EXTRA_LONG_DOUBLE_yes): Remove csqrtl.c
(EXTRA_DIST): Remove csqrt.c and csqrtf.c.
* libmath/Makefile.in: Regenerate.
* libmath/complex-stub.h: Remove.
* libmath/csqrt.c: Likewise.
* libmath/sqrtf.c: Likewise.
* libmath/sqrtl.c: Likewise.
* libmath/mathconf.h: Remove <complex.h> and "complex-stub.h"
#inclusion.
* include/bits/std_complex.h (sqrt<>): Define primary template.
(complex<>): Remove sqrt friend declarations.
* configure.in: Initialize with src/ios.cc.
* configure: Regenerate.
* acinclude.m4: Remove check for csqrt* and <complex.h>
* aclocal.m4: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
2000-12-20 Phil Edwards <pme@sources.redhat.com>
* acinclude.m4 (SECTION_FLAGS, OPT_LDFLAGS): Fix minor thinko.
......
......@@ -136,48 +136,7 @@ MULTICLEAN = true
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"EXPECT=$(EXPECT)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
"CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"NM=$(NM)" \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "EXPECT=$(EXPECT)" "RUNTEST=$(RUNTEST)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
......
......@@ -748,9 +748,8 @@ dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
dnl Check for complex versions of math functions of platform.
AC_CHECK_HEADERS([complex.h])
AC_CHECK_LIB(m, main)
AC_REPLACE_MATHFUNCS(csqrt csqrtf nan hypot hypotf atan2f expf copysignf)
AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
dnl Compile the long double complex functions only if the function
dnl provides the non-complex long double functions that are needed.
......@@ -760,7 +759,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
if test x$ac_cv_func_atan2l = x"yes" \
&& test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
AC_REPLACE_MATHFUNCS(csqrtl hypotl signbitl)
AC_REPLACE_MATHFUNCS(hypotl signbitl)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
......
......@@ -760,9 +760,8 @@ dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
dnl Check for complex versions of math functions of platform.
AC_CHECK_HEADERS([complex.h])
AC_CHECK_LIB(m, main)
AC_REPLACE_MATHFUNCS(csqrt csqrtf nan hypot hypotf atan2f expf copysignf)
AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
dnl Compile the long double complex functions only if the function
dnl provides the non-complex long double functions that are needed.
......@@ -772,7 +771,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
if test x$ac_cv_func_atan2l = x"yes" \
&& test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
AC_REPLACE_MATHFUNCS(csqrtl hypotl signbitl)
AC_REPLACE_MATHFUNCS(hypotl signbitl)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@
# aclocal, autoconf, autoheader, automake
AC_PREREQ(2.13)
AC_INIT(src/complex.cc)
AC_INIT(src/ios.cc)
AC_CONFIG_AUX_DIR(..)
# Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
......
......@@ -451,6 +451,28 @@ namespace std
}
template<typename _Tp>
complex<_Tp>
sqrt(const complex<_Tp>& __z)
{
_Tp __x = __z.real();
_Tp __y = __z.imag();
if (__x == _Tp())
{
_Tp __t = sqrt(abs(__y) / 2);
return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
}
else
{
_Tp __t = sqrt( 2 * abs(__z) + abs(__x));
_Tp __u = __t / 2;
return __x > _Tp()
? complex<_Tp>(__u, __y / __t)
: complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
}
}
template<typename _Tp>
inline complex<_Tp>
tan(const complex<_Tp>& __z)
{
......@@ -537,8 +559,6 @@ namespace std
friend class complex<double>;
friend class complex<long double>;
friend complex<float> sqrt<>(const complex<float>&);
};
inline float
......@@ -685,8 +705,6 @@ namespace std
friend class complex<float>;
friend class complex<long double>;
friend complex<double> sqrt<>(const complex<double>&);
};
inline double
......@@ -833,8 +851,6 @@ namespace std
friend class complex<float>;
friend class complex<double>;
friend complex<long double> sqrt<>(const complex<long double>&);
};
inline
......
......@@ -26,10 +26,10 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
noinst_LTLIBRARIES = libmath.la
EXTRA_LONG_DOUBLE_yes = \
csqrtl.c hypotl.c signbitl.c
hypotl.c signbitl.c
EXTRA_DIST = \
csqrt.c csqrtf.c hypot.c hypotf.c atan2f.c expf.c \
hypot.c hypotf.c atan2f.c expf.c \
$(EXTRA_LONG_DOUBLE_yes)
libmath_la_LIBADD = \
......
......@@ -114,24 +114,18 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
noinst_LTLIBRARIES = libmath.la
EXTRA_LONG_DOUBLE_yes = \
csqrtl.c hypotl.c signbitl.c
EXTRA_LONG_DOUBLE_yes = hypotl.c signbitl.c
EXTRA_DIST = \
csqrt.c csqrtf.c hypot.c hypotf.c atan2f.c expf.c \
$(EXTRA_LONG_DOUBLE_yes)
EXTRA_DIST = hypot.c hypotf.c atan2f.c expf.c $(EXTRA_LONG_DOUBLE_yes)
libmath_la_LIBADD = \
@LIBMATHOBJS@ \
$(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
libmath_la_LIBADD = @LIBMATHOBJS@ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = \
signbit.c signbitf.c
libmath_la_SOURCES = signbit.c signbitf.c
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
......@@ -145,9 +139,7 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
INCLUDES = \
-I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include \
$(TOPLEVEL_INCLUDES)
INCLUDES = -I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include $(TOPLEVEL_INCLUDES)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h
......
/* Copyright (C) 1997-1999, 2000 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. */
/* This is no header meant to be used in general. It's simply here to
get libstdc++ compiled. It should never be installed in an official
directory. */
#ifndef _COMPLEX_H
#define _COMPLEX_H 1
__complex__ double csqrt (__complex__ double x);
__complex__ float csqrtf (__complex__ float x);
__complex__ long double csqrtl (__complex__ long double x);
#endif
/* Complex square root of 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"
__complex__ double
csqrt (__complex__ double x)
{
__complex__ double res;
if (!FINITE_P (__real__ x) || !FINITE_P (__imag__ x))
{
if (INFINITE_P (__imag__ x))
{
__real__ res = HUGE_VAL;
__imag__ res = __imag__ x;
}
else if (INFINITE_P (__real__ x))
{
if (__real__ x < 0.0)
{
__real__ res = __imag__ x != __imag__ x ? NAN : 0;
__imag__ res = copysign (HUGE_VAL, __imag__ x);
}
else
{
__real__ res = __real__ x;
__imag__ res = (__imag__ x != __imag__ x
? NAN : copysign (0.0, __imag__ x));
}
}
else
{
__real__ res = NAN;
__imag__ res = NAN;
}
}
else
{
if (__imag__ x == 0.0)
{
if (__real__ x < 0.0)
{
__real__ res = 0.0;
__imag__ res = copysign (sqrt (-__real__ x), __imag__ x);
}
else
{
__real__ res = fabs (sqrt (__real__ x));
__imag__ res = copysign (0.0, __imag__ x);
}
}
else if (__real__ x == 0.0)
{
double r = sqrt (0.5 * fabs (__imag__ x));
__real__ res = copysign (r, __imag__ x);
__imag__ res = r;
}
else
{
__complex__ double q;
double t, r;
if (fabs (__imag__ x) < 2.0e-4 * fabs (__real__ x))
t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
else
t = 0.5 * (hypot (__real__ x, __imag__ x) - __real__ x);
r = sqrt (t);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
}
}
return res;
}
/* Complex square root of 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"
__complex__ float
csqrtf (__complex__ float x)
{
__complex__ float res;
if (!FINITEF_P (__real__ x) || !FINITEF_P (__imag__ x))
{
if (INFINITEF_P (__imag__ x))
{
__real__ res = HUGE_VALF;
__imag__ res = __imag__ x;
}
else if (INFINITEF_P (__real__ x))
{
if (__real__ x < 0.0)
{
__real__ res = __imag__ x != __imag__ x ? NAN : 0;
__imag__ res = copysignf (HUGE_VALF, __imag__ x);
}
else
{
__real__ res = __real__ x;
__imag__ res = (__imag__ x != __imag__ x
? NAN : copysignf (0.0, __imag__ x));
}
}
else
{
__real__ res = NAN;
__imag__ res = NAN;
}
}
else
{
if (__imag__ x == 0.0)
{
if (__real__ x < 0.0)
{
__real__ res = 0.0;
__imag__ res = copysignf (sqrtf (-__real__ x), __imag__ x);
}
else
{
__real__ res = fabsf (sqrtf (__real__ x));
__imag__ res = copysignf (0.0, __imag__ x);
}
}
else if (__real__ x == 0.0)
{
float r = sqrtf (0.5 * fabsf (__imag__ x));
__real__ res = copysignf (r, __imag__ x);
__imag__ res = r;
}
else
{
__complex__ float q;
float t, r;
if (fabsf (__imag__ x) < 2.0e-4 * fabsf (__real__ x))
t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
else
t = 0.5 * (hypotf (__real__ x, __imag__ x) - __real__ x);
r = sqrtf (t);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
}
}
return res;
}
/* Complex square root of 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"
/* 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
csqrtl (__complex__ long double x)
{
__complex__ long double res;
if (!FINITEL_P (__real__ x) || !FINITEL_P (__imag__ x))
{
if (INFINITEL_P (__imag__ x))
{
__real__ res = HUGE_VALL;
__imag__ res = __imag__ x;
}
else if (INFINITEL_P (__real__ x))
{
if (__real__ x < 0.0)
{
__real__ res = __imag__ x != __imag__ x ? NAN : 0;
__imag__ res = copysignl (HUGE_VALL, __imag__ x);
}
else
{
__real__ res = __real__ x;
__imag__ res = (__imag__ x != __imag__ x
? NAN : copysignl (0.0, __imag__ x));
}
}
else
{
__real__ res = NAN;
__imag__ res = NAN;
}
}
else
{
if (__imag__ x == 0.0)
{
if (__real__ x < 0.0)
{
__real__ res = 0.0;
__imag__ res = copysignl (sqrtl (-__real__ x), __imag__ x);
}
else
{
__real__ res = fabsl (sqrtl (__real__ x));
__imag__ res = copysignl (0.0, __imag__ x);
}
}
else if (__real__ x == 0.0)
{
long double r = sqrtl (0.5 * fabsl (__imag__ x));
__real__ res = copysignl (r, __imag__ x);
__imag__ res = r;
}
else
{
__complex__ long double q;
long double t, r;
if (fabsl (__imag__ x) < 2.0e-4 * fabsl (__real__ x))
t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
else
t = 0.5 * (local_hypotl (__real__ x, __imag__ x) - __real__ x);
r = sqrtl (t);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
}
}
return res;
}
......@@ -227,12 +227,6 @@ double nan (void);
extern "C" {
#endif
#ifdef _GLIBCPP_HAVE_COMPLEX_H
# include <complex.h>
#else
# include "complex-stub.h"
#endif
/* signbit is a macro in ISO C99. */
#ifndef signbit
extern int __signbitf (float);
......
......@@ -21,7 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
## $Id: Makefile.am,v 1.58 2000/12/15 00:55:02 bkoz Exp $
## $Id: Makefile.am,v 1.59 2000/12/18 18:03:08 bkoz Exp $
AUTOMAKE_OPTIONS = 1.3 gnits
MAINT_CHARSET = latin1
......@@ -174,7 +174,7 @@ build_headers = \
sources = \
limitsMEMBERS.cc \
complex.cc complexf.cc complexl.cc complex_io.cc \
complex_io.cc \
stdexcept.cc bitset.cc \
c++io.cc ios.cc stdstreams.cc strstream.cc \
locale.cc localename.cc codecvt.cc \
......
// The template and inlines for the -*- C++ -*- complex number classes.
// Copyright (C) 1997-2000 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 <bits/std_complex.h>
// This is a ISO C99 header.
#include <mathconf.h>
#undef complex
#ifndef FLT
# define FLT double
#endif
// This file often breaks due to compiler bugs. May need to put in guards, ie:
// #if defined(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
// and
// #if defined(_GLIBCPP_FLOAT_SPECIALIZATION)
namespace std
{
template<>
complex<FLT>
sqrt(const complex<FLT>& __x)
{ return complex<FLT>(csqrt(__x._M_value)); }
} // namespace std
#define FLT float
// Used in complex.cc to work around GCC's buggy __complex__ float support.
#define _GLIBCPP_FLOAT_SPECIALIZATION 1
#include "complex.cc"
#define FLT long double
#include "complex.cc"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment