📄 perl.h
字号:
# define DBL_MIN MINDOUBLE# endif# endif#endif /* defined(I_VALUES) */typedef NVTYPE NV;#ifdef I_IEEEFP# include <ieeefp.h>#endif#ifdef USE_LONG_DOUBLE# ifdef I_SUNMATH# include <sunmath.h># endif# define NV_DIG LDBL_DIG# ifdef LDBL_MANT_DIG# define NV_MANT_DIG LDBL_MANT_DIG# endif# ifdef LDBL_MIN# define NV_MIN LDBL_MIN# endif# ifdef LDBL_MAX# define NV_MAX LDBL_MAX# endif# ifdef LDBL_MIN_10_EXP# define NV_MIN_10_EXP LDBL_MIN_10_EXP# endif# ifdef LDBL_MAX_10_EXP# define NV_MAX_10_EXP LDBL_MAX_10_EXP# endif# ifdef LDBL_EPSILON# define NV_EPSILON LDBL_EPSILON# endif# ifdef LDBL_MAX# define NV_MAX LDBL_MAX/* Having LDBL_MAX doesn't necessarily mean that we have LDBL_MIN... -Allen */# else# ifdef HUGE_VALL# define NV_MAX HUGE_VALL# else# ifdef HUGE_VAL# define NV_MAX ((NV)HUGE_VAL)# endif# endif# endif# ifdef HAS_SQRTL# define Perl_cos cosl# define Perl_sin sinl# define Perl_sqrt sqrtl# define Perl_exp expl# define Perl_log logl# define Perl_atan2 atan2l# define Perl_pow powl# define Perl_floor floorl# define Perl_ceil ceill# define Perl_fmod fmodl# endif/* e.g. libsunmath doesn't have modfl and frexpl as of mid-March 2000 */# ifdef HAS_MODFL# define Perl_modf(x,y) modfl(x,y)/* eg glibc 2.2 series seems to provide modfl on ppc and arm, but has no prototype in <math.h> */# ifndef HAS_MODFL_PROTOEXTERN_C long double modfl(long double, long double *);# endif# else# if defined(HAS_AINTL) && defined(HAS_COPYSIGNL) extern long double Perl_my_modfl(long double x, long double *ip);# define Perl_modf(x,y) Perl_my_modfl(x,y)# endif# endif# ifdef HAS_FREXPL# define Perl_frexp(x,y) frexpl(x,y)# else# if defined(HAS_ILOGBL) && defined(HAS_SCALBNL) extern long double Perl_my_frexpl(long double x, int *e);# define Perl_frexp(x,y) Perl_my_frexpl(x,y)# endif# endif# ifndef Perl_isnan# ifdef HAS_ISNANL# define Perl_isnan(x) isnanl(x)# endif# endif# ifndef Perl_isinf# ifdef HAS_FINITEL# define Perl_isinf(x) !(finitel(x)||Perl_isnan(x))# endif# endif#else# define NV_DIG DBL_DIG# ifdef DBL_MANT_DIG# define NV_MANT_DIG DBL_MANT_DIG# endif# ifdef DBL_MIN# define NV_MIN DBL_MIN# endif# ifdef DBL_MAX# define NV_MAX DBL_MAX# endif# ifdef DBL_MIN_10_EXP# define NV_MIN_10_EXP DBL_MIN_10_EXP# endif# ifdef DBL_MAX_10_EXP# define NV_MAX_10_EXP DBL_MAX_10_EXP# endif# ifdef DBL_EPSILON# define NV_EPSILON DBL_EPSILON# endif# ifdef DBL_MAX /* XXX Does DBL_MAX imply having DBL_MIN? */# define NV_MAX DBL_MAX# define NV_MIN DBL_MIN# else# ifdef HUGE_VAL# define NV_MAX HUGE_VAL# endif# endif# define Perl_cos cos# define Perl_sin sin# define Perl_sqrt sqrt# define Perl_exp exp# define Perl_log log# define Perl_atan2 atan2# define Perl_pow pow# define Perl_floor floor# define Perl_ceil ceil# define Perl_fmod fmod# define Perl_modf(x,y) modf(x,y)# define Perl_frexp(x,y) frexp(x,y)#endif/* rumor has it that Win32 has _fpclass() *//* SGI has fpclassl... but not with the same result values, * and it's via a typedef (not via #define), so will need to redo Configure * to use. Not worth the trouble, IMO, at least until the below is used * more places. Also has fp_class_l, BTW, via fp_class.h. Feel free to check * with me for the SGI manpages, SGI testing, etcetera, if you want to * try getting this to work with IRIX. - Allen <allens@cpan.org> */#if !defined(Perl_fp_class) && (defined(HAS_FPCLASS)||defined(HAS_FPCLASSL))# ifdef I_IEEFP# include <ieeefp.h># endif# ifdef I_FP# include <fp.h># endif# if defined(USE_LONG_DOUBLE) && defined(HAS_FPCLASSL)# define Perl_fp_class() fpclassl(x)# else# define Perl_fp_class() fpclass(x)# endif# define Perl_fp_class_snan(x) (Perl_fp_class(x)==FP_CLASS_SNAN)# define Perl_fp_class_qnan(x) (Perl_fp_class(x)==FP_CLASS_QNAN)# define Perl_fp_class_nan(x) (Perl_fp_class(x)==FP_CLASS_SNAN||Perl_fp_class(x)==FP_CLASS_QNAN)# define Perl_fp_class_ninf(x) (Perl_fp_class(x)==FP_CLASS_NINF)# define Perl_fp_class_pinf(x) (Perl_fp_class(x)==FP_CLASS_PINF)# define Perl_fp_class_inf(x) (Perl_fp_class(x)==FP_CLASS_NINF||Perl_fp_class(x)==FP_CLASS_PINF)# define Perl_fp_class_nnorm(x) (Perl_fp_class(x)==FP_CLASS_NNORM)# define Perl_fp_class_pnorm(x) (Perl_fp_class(x)==FP_CLASS_PNORM)# define Perl_fp_class_norm(x) (Perl_fp_class(x)==FP_CLASS_NNORM||Perl_fp_class(x)==FP_CLASS_PNORM)# define Perl_fp_class_ndenorm(x) (Perl_fp_class(x)==FP_CLASS_NDENORM)# define Perl_fp_class_pdenorm(x) (Perl_fp_class(x)==FP_CLASS_PDENORM)# define Perl_fp_class_denorm(x) (Perl_fp_class(x)==FP_CLASS_NDENORM||Perl_fp_class(x)==FP_CLASS_PDENORM)# define Perl_fp_class_nzero(x) (Perl_fp_class(x)==FP_CLASS_NZERO)# define Perl_fp_class_pzero(x) (Perl_fp_class(x)==FP_CLASS_PZERO)# define Perl_fp_class_zero(x) (Perl_fp_class(x)==FP_CLASS_NZERO||Perl_fp_class(x)==FP_CLASS_PZERO)#endif#if !defined(Perl_fp_class) && defined(HAS_FP_CLASS) && !defined(PERL_MICRO)# include <math.h># if !defined(FP_SNAN) && defined(I_FP_CLASS)# include <fp_class.h># endif# define Perl_fp_class(x) fp_class(x)# define Perl_fp_class_snan(x) (fp_class(x)==FP_SNAN)# define Perl_fp_class_qnan(x) (fp_class(x)==FP_QNAN)# define Perl_fp_class_nan(x) (fp_class(x)==FP_SNAN||fp_class(x)==FP_QNAN)# define Perl_fp_class_ninf(x) (fp_class(x)==FP_NEG_INF)# define Perl_fp_class_pinf(x) (fp_class(x)==FP_POS_INF)# define Perl_fp_class_inf(x) (fp_class(x)==FP_NEG_INF||fp_class(x)==FP_POS_INF)# define Perl_fp_class_nnorm(x) (fp_class(x)==FP_NEG_NORM)# define Perl_fp_class_pnorm(x) (fp_class(x)==FP_POS_NORM)# define Perl_fp_class_norm(x) (fp_class(x)==FP_NEG_NORM||fp_class(x)==FP_POS_NORM)# define Perl_fp_class_ndenorm(x) (fp_class(x)==FP_NEG_DENORM)# define Perl_fp_class_pdenorm(x) (fp_class(x)==FP_POS_DENORM)# define Perl_fp_class_denorm(x) (fp_class(x)==FP_NEG_DENORM||fp_class(x)==FP_POS_DENORM)# define Perl_fp_class_nzero(x) (fp_class(x)==FP_NEG_ZERO)# define Perl_fp_class_pzero(x) (fp_class(x)==FP_POS_ZERO)# define Perl_fp_class_zero(x) (fp_class(x)==FP_NEG_ZERO||fp_class(x)==FP_POS_ZERO)#endif#if !defined(Perl_fp_class) && defined(HAS_FPCLASSIFY)# include <math.h># define Perl_fp_class(x) fpclassify(x)# define Perl_fp_class_nan(x) (fp_classify(x)==FP_SNAN||fp_classify(x)==FP_QNAN)# define Perl_fp_class_inf(x) (fp_classify(x)==FP_INFINITE)# define Perl_fp_class_norm(x) (fp_classify(x)==FP_NORMAL)# define Perl_fp_class_denorm(x) (fp_classify(x)==FP_SUBNORMAL)# define Perl_fp_class_zero(x) (fp_classify(x)==FP_ZERO)#endif#if !defined(Perl_fp_class) && defined(HAS_CLASS)# include <math.h># ifndef _cplusplus# define Perl_fp_class(x) class(x)# else# define Perl_fp_class(x) _class(x)# endif# define Perl_fp_class_snan(x) (Perl_fp_class(x)==FP_NANS)# define Perl_fp_class_qnan(x) (Perl_fp_class(x)==FP_NANQ)# define Perl_fp_class_nan(x) (Perl_fp_class(x)==FP_SNAN||Perl_fp_class(x)==FP_QNAN)# define Perl_fp_class_ninf(x) (Perl_fp_class(x)==FP_MINUS_INF)# define Perl_fp_class_pinf(x) (Perl_fp_class(x)==FP_PLUS_INF)# define Perl_fp_class_inf(x) (Perl_fp_class(x)==FP_MINUS_INF||Perl_fp_class(x)==FP_PLUS_INF)# define Perl_fp_class_nnorm(x) (Perl_fp_class(x)==FP_MINUS_NORM)# define Perl_fp_class_pnorm(x) (Perl_fp_class(x)==FP_PLUS_NORM)# define Perl_fp_class_norm(x) (Perl_fp_class(x)==FP_MINUS_NORM||Perl_fp_class(x)==FP_PLUS_NORM)# define Perl_fp_class_ndenorm(x) (Perl_fp_class(x)==FP_MINUS_DENORM)# define Perl_fp_class_pdenorm(x) (Perl_fp_class(x)==FP_PLUS_DENORM)# define Perl_fp_class_denorm(x) (Perl_fp_class(x)==FP_MINUS_DENORM||Perl_fp_class(x)==FP_PLUS_DENORM)# define Perl_fp_class_nzero(x) (Perl_fp_class(x)==FP_MINUS_ZERO)# define Perl_fp_class_pzero(x) (Perl_fp_class(x)==FP_PLUS_ZERO)# define Perl_fp_class_zero(x) (Perl_fp_class(x)==FP_MINUS_ZERO||Perl_fp_class(x)==FP_PLUS_ZERO)#endif/* rumor has it that Win32 has _isnan() */#ifndef Perl_isnan# ifdef HAS_ISNAN# define Perl_isnan(x) isnan((NV)x)# else# ifdef Perl_fp_class_nan# define Perl_isnan(x) Perl_fp_class_nan(x)# else# ifdef HAS_UNORDERED# define Perl_isnan(x) unordered((x), 0.0)# else# define Perl_isnan(x) ((x)!=(x))# endif# endif# endif#endif#ifdef UNDER_CEint isnan(double d);#endif#ifndef Perl_isinf# ifdef HAS_ISINF# define Perl_isinf(x) isinf((NV)x)# else# ifdef Perl_fp_class_inf# define Perl_isinf(x) Perl_fp_class_inf(x)# else# define Perl_isinf(x) ((x)==NV_INF)# endif# endif#endif#ifndef Perl_isfinite# ifdef HAS_FINITE# define Perl_isfinite(x) finite((NV)x)# else# ifdef HAS_ISFINITE# define Perl_isfinite(x) isfinite(x)# else# ifdef Perl_fp_class_finite# define Perl_isfinite(x) Perl_fp_class_finite(x)# else# define Perl_isfinite(x) !(Perl_is_inf(x)||Perl_is_nan(x))# endif# endif# endif#endif/* The default is to use Perl's own atof() implementation (in numeric.c). * Usually that is the one to use but for some platforms (e.g. UNICOS) * it is however best to use the native implementation of atof. * You can experiment with using your native one by -DUSE_PERL_ATOF=0. * Some good tests to try out with either setting are t/base/num.t, * t/op/numconvert.t, and t/op/pack.t. Note that if using long doubles * you may need to be using a different function than atof! */#ifndef USE_PERL_ATOF# ifndef _UNICOS# define USE_PERL_ATOF# endif#else# if USE_PERL_ATOF == 0# undef USE_PERL_ATOF# endif#endif#ifdef USE_PERL_ATOF# define Perl_atof(s) Perl_my_atof(s)# define Perl_atof2(s, n) Perl_my_atof2(aTHX_ (s), &(n))#else# define Perl_atof(s) (NV)atof(s)# define Perl_atof2(s, n) ((n) = atof(s))#endif/* Previously these definitions used hardcoded figures. * It is hoped these formula are more portable, although * no data one way or another is presently known to me. * The "PERL_" names are used because these calculated constants * do not meet the ANSI requirements for LONG_MAX, etc., which * need to be constants acceptable to #if - kja * define PERL_LONG_MAX 2147483647L * define PERL_LONG_MIN (-LONG_MAX - 1) * define PERL ULONG_MAX 4294967295L */#ifdef I_LIMITS /* Needed for cast_xxx() functions below. */# include <limits.h>#endif/* Included values.h above if necessary; still including limits.h down here, * despite doing above, because math.h might have overriden... XXX - Allen *//* * Try to figure out max and min values for the integral types. THE CORRECT * SOLUTION TO THIS MESS: ADAPT enquire.c FROM GCC INTO CONFIGURE. The * following hacks are used if neither limits.h or values.h provide them: * U<TYPE>_MAX: for types >= int: ~(unsigned TYPE)0 * for types < int: (unsigned TYPE)~(unsigned)0 * The argument to ~ must be unsigned so that later signed->unsigned * conversion can't modify the value's bit pattern (e.g. -0 -> +0), * and it must not be smaller than int because ~ does integral promotion. * <type>_MAX: (<type>) (U<type>_MAX >> 1) * <type>_MIN: -<type>_MAX - <is_twos_complement_architecture: (3 & -1) == 3>. * The latter is a hack which happens to work on some machines but * does *not* catch any random system, or things like integer types * with NaN if that is possible. * * All of the types are explicitly cast to prevent accidental loss of * numeric range, and in the hope that they will be less likely to confuse * over-eager optimizers. * */#define PERL_UCHAR_MIN ((unsigned char)0)#ifdef UCHAR_MAX# define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)#else# ifdef MAXUCHAR# define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)# else# define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)# endif#endif/* * CHAR_MIN and CHAR_MAX are not included here, as the (char) type may be * ambiguous. It may be equivalent to (signed char) or (unsigned char) * depending on local options. Until Configure detects this (or at least * detects whether the "signed" keyword is available) the CHAR ranges * will not be included. UCHAR functions normally. * - kja */#define PERL_USHORT_MIN ((unsigned short)0)#ifdef USHORT_MAX# define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)#else# ifdef MAXUSHORT# define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)# else# ifdef USHRT_MAX# define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)# else# define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)# endif# endif#endif#ifdef SHORT_MAX# define PERL_SHORT_MAX ((short)SHORT_MAX)#else# ifdef MAXSHORT /* Often used in <values.h> */# define PERL_SHORT_MAX ((short)MAXSHORT)# else# ifdef SHRT_MAX# define PERL_SHORT_MAX ((short)SHRT_MAX)# else# define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))# endif# endif#endif#ifdef SHORT_MIN# define PERL_SHORT_MIN ((short)SHORT_MIN)#else# ifdef MINSHORT# define PERL_SHORT_MIN ((short)MINSHORT)# else# ifdef SHRT_MIN# define PERL_SHORT_MIN ((short)SHRT_MIN)# else# define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))# endif# endif#endif#ifdef UINT_MAX# define PERL_UINT_MAX ((unsigned int)UINT_MAX)#else# ifdef MAXUINT# define PERL_UINT_MAX ((unsigned int)MAXUINT)# else# define PERL_UINT_MAX (~(unsigned int)0)# endif#endif#define PERL_UINT_MIN ((unsigned int)0)#ifdef INT_MAX# define PERL_INT_MAX ((int)INT_MAX)#else# ifdef MAXINT /* Often used in <values.h> */# define PERL_INT_MAX ((int)MAXINT)# else# define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))# endif#endif#ifdef INT_MIN# define PERL_INT_MIN ((int)INT_MIN)#else# ifdef MININT# define PERL_INT_MIN ((int)MININT)# else# define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))# endif#endif#ifdef ULONG_MAX# define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)#else# ifdef MAXULONG# define PERL_ULONG_MAX ((unsigned long)MAXULONG)# else# define PERL_ULONG_MAX (~(unsigned long)0)# endif#endif#define PERL_ULONG_MIN ((unsigned long)0L)#ifdef LONG_MAX# define PERL_LONG_MAX ((long)LONG_MAX)#else# ifdef MAXLONG /* Often used in <values.h> */#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -