#include <math.h>
#include <stl/_cstdlib.h>
Go to the source code of this file.
|
#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) |
|
◆ _STLP_CMATH_FUNC_NAMESPACE
#define _STLP_CMATH_FUNC_NAMESPACE |
◆ _STLP_DEF_MATH_INLINE
Value:
_STLP_MATH_INLINE_D(
double,
func,
cf) \
_STLP_MATH_INLINE(
long double,
func,
cf##
l)
#define _STLP_MATH_INLINE(float_type, func, cfunc)
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
Value:
_STLP_MATH_INLINE2_D(
double,
double,
func,
cf) \
_STLP_MATH_INLINE2(
long double,
long double,
func,
cf##
l)
#define _STLP_MATH_INLINE2(float_type, type, func, cfunc)
Definition at line 235 of file _cmath.h.
◆ _STLP_DEF_MATH_INLINE2I
Value:
_STLP_MATH_INLINE2_D(
double,
int,
func,
cf) \
_STLP_MATH_INLINE2(
long double,
int,
func,
cf##
l)
Definition at line 247 of file _cmath.h.
◆ _STLP_DEF_MATH_INLINE2P
Value:
_STLP_MATH_INLINE2_D(
double,
double *,
func,
cf) \
_STLP_MATH_INLINE2(
long double,
long double *,
func,
cf##
l)
Definition at line 239 of file _cmath.h.
◆ _STLP_DEF_MATH_INLINE2PI
Value:
_STLP_MATH_INLINE2_D(
double,
int *,
func,
cf) \
_STLP_MATH_INLINE2(
long double,
int *,
func,
cf##
l)
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); } |
◆ _STLP_MATH_INLINE2
◆ _STLP_MATH_INLINE2_D
◆ _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); \
}
#define __STATIC_CAST(__x, __y)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
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)); }
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)); }
Definition at line 201 of file _cmath.h.
◆ _STLP_MATH_INLINE_D
#define _STLP_MATH_INLINE_D |
( |
|
float_type, |
|
|
|
func, |
|
|
|
cfunc |
|
) |
| |
◆ _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)); }
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.
◆ abs()
Definition at line 424 of file _cmath.h.
425{ return ::fabs(__x); }
◆ pow() [1/3]
◆ pow() [2/3]
◆ pow() [3/3]
Definition at line 469 of file _cmath.h.
469{
return _STLP_CMATH_FUNC_NAMESPACE::powl(__x,
__STATIC_CAST(
long double,__y)); }