/home/ntakagi/work/STLport-5.1.5/stlport/stl/_cmath.h File Reference

#include <math.h>
#include <stl/_cstdlib.h>

Go to the source code of this file.

Defines

#define _STLP_CMATH_FUNC_NAMESPACE
#define _STLP_MATH_INLINE(float_type, func, cfunc)   inline float_type func (float_type x) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x); }
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)   inline float_type func (float_type x, type y) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x, y); }
#define _STLP_MATH_INLINE_D(float_type, func, cfunc)
#define _STLP_MATH_INLINE2_D(float_type, type, func, cfunc)
#define _STLP_MATH_INLINEX(__type, func, cfunc)
#define _STLP_MATH_INLINE2X(__type1, __type2, func, cfunc)
#define _STLP_MATH_INLINE2PX(__type, func, cfunc)
#define _STLP_MATH_INLINE2XX(__type, func, cfunc)
#define _STLP_DEF_MATH_INLINE(func, cf)
#define _STLP_DEF_MATH_INLINE2(func, cf)
#define _STLP_DEF_MATH_INLINE2P(func, cf)
#define _STLP_DEF_MATH_INLINE2PI(func, cf)
#define _STLP_DEF_MATH_INLINE2I(func, cf)

Functions

double abs (double __x)
float pow (float __x, int __y)
double pow (double __x, int __y)
long double pow (long double __x, int __y)


Define Documentation

#define _STLP_CMATH_FUNC_NAMESPACE

Definition at line 150 of file _cmath.h.

#define _STLP_DEF_MATH_INLINE ( func,
cf   ) 

Value:

_STLP_MATH_INLINE(float,func,cf##f) \
  _STLP_MATH_INLINE_D(double,func,cf) \
  _STLP_MATH_INLINE(long double,func,cf##l)
rough characterization of compiler and native C library For the compiler, it can either support long double or not. If it doesn't, the macro _STLP_NO_LONG_DOUBLE is not defined and we don't define any long double overloads. For the native C library the question is whether it has variants with an 'f' suffix (for float as opposed to double) or an 'l' suffix (for long double). If the float variants are missing, _STLP_NO_VENDOR_MATH_F is defined, when the long double variants are missing, _STLP_NO_VENDOR_MATH_L is defined. Of course the latter doesn't make sense anyway when the compiler already has no long double support.

Those two traits determine a) which overloads get defined and b) how they are defined.

Meaning of suffixes: "" : function returning and taking a float_type "2" : function returning a float_type and taking to float_types "2P" : function returning a float_type and taking a float_type and a float_type* "2PI": function returning a float_type and taking a float_type and an int* "2I" : function returning a float_type and taking a float_Type and an int

Definition at line 222 of file _cmath.h.

#define _STLP_DEF_MATH_INLINE2 ( func,
cf   ) 

Value:

_STLP_MATH_INLINE2(float,float,func,cf##f) \
  _STLP_MATH_INLINE2_D(double,double,func,cf) \
  _STLP_MATH_INLINE2(long double,long double,func,cf##l)

Definition at line 226 of file _cmath.h.

#define _STLP_DEF_MATH_INLINE2I ( func,
cf   ) 

Value:

_STLP_MATH_INLINE2(float,int,func,cf##f) \
  _STLP_MATH_INLINE2_D(double,int,func,cf) \
  _STLP_MATH_INLINE2(long double,int,func,cf##l)

Definition at line 238 of file _cmath.h.

#define _STLP_DEF_MATH_INLINE2P ( func,
cf   ) 

Value:

_STLP_MATH_INLINE2(float,float *,func,cf##f) \
  _STLP_MATH_INLINE2_D(double,double *,func,cf) \
  _STLP_MATH_INLINE2(long double,long double *,func,cf##l)

Definition at line 230 of file _cmath.h.

#define _STLP_DEF_MATH_INLINE2PI ( func,
cf   ) 

Value:

_STLP_MATH_INLINE2(float,int *,func,cf##f) \
  _STLP_MATH_INLINE2_D(double,int *,func,cf) \
  _STLP_MATH_INLINE2(long double,int *,func,cf##l)

Definition at line 234 of file _cmath.h.

#define _STLP_MATH_INLINE ( float_type,
func,
cfunc   )     inline float_type func (float_type x) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x); }

Definition at line 154 of file _cmath.h.

#define _STLP_MATH_INLINE2 ( float_type,
type,
func,
cfunc   )     inline float_type func (float_type x, type y) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x, y); }

Definition at line 156 of file _cmath.h.

#define _STLP_MATH_INLINE2_D ( float_type,
type,
func,
cfunc   ) 

Definition at line 159 of file _cmath.h.

#define _STLP_MATH_INLINE2PX ( __type,
func,
cfunc   ) 

Value:

inline __type func (__type x, __type *y) { \
    double tmp1, tmp2; \
    tmp1 = _STLP_CMATH_FUNC_NAMESPACE::cfunc(__STATIC_CAST(double, x), &tmp2); \
    *y = __STATIC_CAST(__type, tmp2); \
    return __STATIC_CAST(__type, tmp1); \
  }

Definition at line 185 of file _cmath.h.

#define _STLP_MATH_INLINE2X ( __type1,
__type2,
func,
cfunc   ) 

Value:

inline __type1 func (__type1 x, __type2 y) \
  { return __STATIC_CAST(__type1, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x, y)); }

Definition at line 182 of file _cmath.h.

#define _STLP_MATH_INLINE2XX ( __type,
func,
cfunc   ) 

Value:

inline __type func (__type x, __type y) \
  { return __STATIC_CAST(__type, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x, (double)y)); }

Definition at line 192 of file _cmath.h.

#define _STLP_MATH_INLINE_D ( float_type,
func,
cfunc   ) 

Definition at line 158 of file _cmath.h.

#define _STLP_MATH_INLINEX ( __type,
func,
cfunc   ) 

Value:

inline __type func (__type x) \
  { return __STATIC_CAST(__type, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x)); }
macros to define math functions These macros (having an X somewhere in the name) forward to the C library's double functions but cast the arguments and return values to the given type.

Definition at line 179 of file _cmath.h.


Function Documentation

double abs ( double  __x  )  [inline]

Definition at line 414 of file _cmath.h.

Referenced by abs().

long double pow ( long double  __x,
int  __y 
) [inline]

Definition at line 459 of file _cmath.h.

References __STATIC_CAST.

double pow ( double  __x,
int  __y 
) [inline]

Definition at line 455 of file _cmath.h.

References __STATIC_CAST, and pow().

float pow ( float  __x,
int  __y 
) [inline]

Definition at line 448 of file _cmath.h.

References __STATIC_CAST.

Referenced by pow().



Generated on Mon Mar 10 15:32:48 2008 by  doxygen 1.5.1