pow(double, int)

Petter Urkedal petter@matfys.lth.se
Wed Apr 5 02:37:00 GMT 2000


I must have been tired yesterday, forgot to send the
patch for src/Makefile.am.  Here it is again, with
some GNUification of `cmath.cc' and a testcase.  Hope
it's right now.

-petter.


2000-04-05  Petter Urkedal  <petter@matfys.lth.se>

        * src/cmath.cc: New file...
        (pow(*, int)): Define functions...
        * src/Makefile.am (sources): ...register file.
        * src/Makefile.in: Regenerate.
        * bits/std_cmath.h (pow): ...declare functions here, and remove
        old definitions.
	* testsuite/26_numerics/cmath_pow_int.cc: Test int versions
	of pow against FP versions.
Index: bits/std_cmath.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/std_cmath.h,v
retrieving revision 1.18
diff -c -r1.18 std_cmath.h
*** std_cmath.h	2000/03/21 06:24:04	1.18
--- std_cmath.h	2000/04/05 08:18:06
***************
*** 52,59 ****
      inline double
      abs(double __x) { return ::fabs(__x); }
  
!     inline double
!     pow(double __x, int __i) { return ::pow(__x, static_cast<double>(__i)); }
  
      // float
      inline float
--- 52,59 ----
      inline double
      abs(double __x) { return ::fabs(__x); }
  
!     double
!     pow(double, int);
  
      // float
      inline float
***************
*** 78,86 ****
      pow(float __x, float __y) 
      { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
  
!     inline float
!     pow(float __x, int __i) 
!     { return ::pow(static_cast<double>(__x), static_cast<double>(__i)); }
  
  #if _GLIBCPP_HAVE_ABSF
      inline float
--- 78,85 ----
      pow(float __x, float __y) 
      { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
  
!     float
!     pow(float, int);
  
  #if _GLIBCPP_HAVE_ABSF
      inline float
***************
*** 239,244 ****
--- 238,246 ----
  
  
      // XXX long double
+ 
+     long double
+     pow(long double, int);
  
  } // std
  
Index: src/Makefile.am
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/Makefile.am,v
retrieving revision 1.89
diff -c -r1.89 Makefile.am
*** Makefile.am	2000/03/27 19:53:00	1.89
--- Makefile.am	2000/04/05 08:18:06
***************
*** 158,164 ****
  
  sources = \
  	limitsMEMBERS.cc c++io.cc \
! 	complex.cc complexf.cc complexl.cc complex_io.cc \
  	stdexcept.cc ios.cc stdstreams.cc strstream.cc \
  	locale.cc localename.cc  \
  	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc \
--- 158,164 ----
  
  sources = \
  	limitsMEMBERS.cc c++io.cc \
! 	cmath.cc complex.cc complexf.cc complexl.cc complex_io.cc \
  	stdexcept.cc ios.cc stdstreams.cc strstream.cc \
  	locale.cc localename.cc  \
  	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc \


More information about the Libstdc++ mailing list