📄 mathloc.h
字号:
/****************************************************************
header for local math definitions
Copyright 1988 Software Development Systems, Inc.
All rights reserved.
****************************************************************/
/*****************************************************************************/
/* internal math routines */
/*****************************************************************************/
extern double _npnom(double x, int n,const double *pc);
extern double _pnom(double x, int n,const double *pc);
/*****************************************************************************/
/* constants */
/*****************************************************************************/
#define SQRT2 1.4142135623730950 /* square root of 2 */
#define SQRT3 1.7320508075688773 /* square root of 3 */
#define PI 3.1415926535897932 /* pi */
#define E 2.7182818284590452 /* e */
#define LOG10E 0.4342944819032518 /* log10(e) */
#define LN2 0.6931471805599453 /* ln(2) */
/*****************************************************************************/
/* limits - most depend on "double" size */
/* these values appear here rather than in particular files so that test */
/* files can use the same values */
/*****************************************************************************/
#if _DBLBITS == 32
#define HUGELOG 88.0 /* approx. ln(largest representable value) */
#define TINYLOG -87.0 /* approx. ln(smallest representable value) */
#define HUGEARC 1.0e+8 /* (|trig fcn arg| > HUGEARC) => TLOSS error */
#define LARGEARC 1.0e+4 /* (|trig fcn arg| > LARGEARC) => PLOSS error */
#define SMALLARC 1.0e-8 /* largest "small arc" */
#define SMALLCOT 1.0e-33 /* minimum deviation of cotan arg from zero */
#else
#define HUGELOG 709.0 /* approx. ln(largest representable value) */
#define TINYLOG -709.0 /* approx. ln(smallest representable value) */
#define HUGEARC 1.0e+10 /* (|trig fcn arg| > HUGEARC) => TLOSS error */
#define LARGEARC 1.0e+5 /* (|trig fcn arg| > LARGEARC) => PLOSS error */
#define SMALLARC 1.0e-10 /* largest "small arc" */
#define SMALLCOT 1.0e-300 /* minimum deviation of cotan arg from zero */
#endif
#define SMALLEXP 1.0e-17 /* minimum deviation of exp arg from zero */
/*****************************************************************************
error macros - these maintain the relation between the ANSI "errno"
and the non-ANSI "matherr". If a matherr function
were desired it could be called from these macros.
DO_DOMAIN handles an argument out of range
DO_OVER handles a positive overflow
DO_NOVER handles a negative overflow
DO_UNDER handles an underflow, where the result is between 0 and
+/- the smallest representable number.
DO_TLOSS handles a total loss of significance (when a function's
input values are not out of range but are so extreme
that the function's algorithm cannot produce meaningful
results from them.
DO_PLOSS handles a partial loss of significance.
*****************************************************************************/
#define DO_DOMAIN errno = EDOM, 0.0
#define DO_OVER errno = ERANGE, HUGE_VAL
#define DO_NOVER errno = ERANGE, -HUGE_VAL
#define DO_UNDER 0.0
#define DO_TLOSS 0.0
#define DO_PLOSS 0.0
/*****************************************************************************/
/* "typedefs" */
/*****************************************************************************/
#define TABLE static const double /* type for all tables */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -