📄 math.h
字号:
/********************************************************************/
/* MATH.H v4.00 */
/* Copyright (c) 1993-2004 Texas Instruments Incorporated */
/********************************************************************/
#ifndef _MATH
#define _MATH
#include <linkage.h>
#include <float.h>
#ifdef __cplusplus
extern "C" namespace std {
#endif
#if _INLINE
#define __INLINE static __inline
#else
#define __INLINE
#endif
#define HUGE_VAL DBL_MAX
#define HUGE_VALL LDBL_MAX
/***************************************************************/
/* FUNCTION DECLARATIONS. */
/***************************************************************/
double asin(double _x);
double acos(double _x);
double atan(double _x);
double atan2(double _y, double _x);
__INLINE double ceil(double _x);
double cos(double _x);
double cosh(double _x);
double exp(double _x);
#if !0 && !defined(__TMS320C27XX__)
double fabs(double _x);
#endif
__INLINE double floor(double _x);
__INLINE double fmod(double _x, double _y);
double frexp(double _x, int *_exp);
double ldexp(double _x, int _exp);
double log(double _x);
double log10(double _x);
double modf(double _x, double *_iptr);
double pow(double _x, double _y);
double sin(double _x);
double sinh(double _x);
double sqrt(double _x);
double tan(double _x);
double tanh(double _x);
#if defined(_INLINE) || defined(_CEIL)
_IDEFN double ceil(double x)
{
double y;
return (modf(x, &y) > 0 ? y + 1.0 : y);
}
#endif /* _INLINE || _CEIL */
#if defined(_INLINE) || defined(_FLOOR)
_IDEFN double floor(double x)
{
double y;
return (modf(x, &y) < 0 ? y - 1.0 : y);
}
#endif /* _INLINE || _CEIL */
#if _INLINE
/****************************************************************************/
/* fmod() */
/****************************************************************************/
static __inline double fmod(double x, double y)
{
double d = fabs(x);
if (d - fabs(y) == d) return (0.0);
modf(x/y, &d);
return (x - d * y);
}
#endif /* _INLINE */
#undef __INLINE
#ifdef __cplusplus
} /* extern "C" namespace std */
using std::asin;
using std::acos;
using std::atan;
using std::atan2;
using std::ceil;
using std::cos;
using std::cosh;
using std::exp;
using std::fabs;
using std::floor;
using std::fmod;
using std::frexp;
using std::ldexp;
using std::log;
using std::log10;
using std::modf;
using std::pow;
using std::sin;
using std::sinh;
using std::sqrt;
using std::tan;
using std::tanh;
#endif /* __cplusplus */
#endif /* _MATH */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -