ReactOS  0.4.14-dev-614-gbfd8a84
_cmath.h File Reference
#include <math.h>
#include <stl/_cstdlib.h>
Include dependency graph for _cmath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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)
 

Macro Definition Documentation

◆ _STLP_CMATH_FUNC_NAMESPACE

#define _STLP_CMATH_FUNC_NAMESPACE

Definition at line 159 of file _cmath.h.

◆ _STLP_DEF_MATH_INLINE

#define _STLP_DEF_MATH_INLINE (   func,
  cf 
)
Value:
_STLP_MATH_INLINE_D(double,func,cf) \
_STLP_MATH_INLINE(long double,func,cf##l)
GLenum func
Definition: glext.h:6028
r l[0]
Definition: byte_order.h:167
GLfloat f
Definition: glext.h:7540
#define _STLP_MATH_INLINE(float_type, func, cfunc)
Definition: _cmath.h:163

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 231 of file _cmath.h.

◆ _STLP_DEF_MATH_INLINE2

#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)
GLenum func
Definition: glext.h:6028
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)
Definition: _cmath.h:165
r l[0]
Definition: byte_order.h:167
GLfloat f
Definition: glext.h:7540

Definition at line 235 of file _cmath.h.

◆ _STLP_DEF_MATH_INLINE2I

#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)
GLenum func
Definition: glext.h:6028
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)
Definition: _cmath.h:165
r l[0]
Definition: byte_order.h:167
GLfloat f
Definition: glext.h:7540

Definition at line 247 of file _cmath.h.

◆ _STLP_DEF_MATH_INLINE2P

#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)
GLenum func
Definition: glext.h:6028
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)
Definition: _cmath.h:165
r l[0]
Definition: byte_order.h:167
GLfloat f
Definition: glext.h:7540

Definition at line 239 of file _cmath.h.

◆ _STLP_DEF_MATH_INLINE2PI

#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)
GLenum func
Definition: glext.h:6028
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)
Definition: _cmath.h:165
r l[0]
Definition: byte_order.h:167
GLfloat f
Definition: glext.h:7540

Definition at line 243 of file _cmath.h.

◆ _STLP_MATH_INLINE

#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 163 of file _cmath.h.

◆ _STLP_MATH_INLINE2

#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 165 of file _cmath.h.

◆ _STLP_MATH_INLINE2_D

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

Definition at line 168 of file _cmath.h.

◆ _STLP_MATH_INLINE2PX

#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); \
}
GLenum func
Definition: glext.h:6028
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Definition at line 194 of file _cmath.h.

◆ _STLP_MATH_INLINE2X

#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)); }
GLenum func
Definition: glext.h:6028
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Definition at line 191 of file _cmath.h.

◆ _STLP_MATH_INLINE2XX

#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)); }
GLenum func
Definition: glext.h:6028
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Definition at line 201 of file _cmath.h.

◆ _STLP_MATH_INLINE_D

#define _STLP_MATH_INLINE_D (   float_type,
  func,
  cfunc 
)

Definition at line 167 of file _cmath.h.

◆ _STLP_MATH_INLINEX

#define _STLP_MATH_INLINEX (   __type,
  func,
  cfunc 
)
Value:
inline __type func (__type x) \
{ return __STATIC_CAST(__type, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x)); }
GLenum func
Definition: glext.h:6028
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

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 188 of file _cmath.h.

Function Documentation

◆ abs()

double abs ( double  __x)
inline

Definition at line 424 of file _cmath.h.

425 { return ::fabs(__x); }
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)

◆ pow() [1/3]

◆ pow() [2/3]

double pow ( double  __x,
int  __y 
)
inline

Definition at line 465 of file _cmath.h.

465 { return _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(double,__y)); }
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
float pow(float __x, int __y)
Definition: _cmath.h:458

◆ pow() [3/3]

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

Definition at line 469 of file _cmath.h.

469 { return _STLP_CMATH_FUNC_NAMESPACE::powl(__x, __STATIC_CAST(long double,__y)); }
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define powl(x, y)
Definition: trio.c:278