The R Project SVN R

Rev

Rev 4562 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4562 Rev 4835
Line 60... Line 60...
60
#ifndef M_LOG2E
60
#ifndef M_LOG2E
61
#define M_LOG2E		1.442695040888963407359924681002	/* log2(e) */
61
#define M_LOG2E		1.442695040888963407359924681002	/* log2(e) */
62
#endif
62
#endif
63
 
63
 
64
#ifndef M_LOG10E
64
#ifndef M_LOG10E
65
#define M_LOG10E        0.434294481903251827651128918917	/* log10(e) */
65
#define M_LOG10E	0.434294481903251827651128918917	/* log10(e) */
66
#endif
66
#endif
67
 
67
 
68
#ifndef M_LN2
68
#ifndef M_LN2
69
#define M_LN2		0.693147180559945309417232121458	/* ln(2) */
69
#define M_LN2		0.693147180559945309417232121458	/* ln(2) */
70
#endif
70
#endif
Line 72... Line 72...
72
#ifndef M_LN10
72
#ifndef M_LN10
73
#define M_LN10		2.302585092994045684017991454684	/* ln(10) */
73
#define M_LN10		2.302585092994045684017991454684	/* ln(10) */
74
#endif
74
#endif
75
 
75
 
76
#ifndef M_PI
76
#ifndef M_PI
77
#define M_PI		3.141592653589793238462643383280        /* pi */
77
#define M_PI		3.141592653589793238462643383280	/* pi */
78
#endif
78
#endif
79
 
79
 
80
#ifndef M_PI_2
80
#ifndef M_PI_2
81
#define M_PI_2		1.570796326794896619231321691640	/* pi/2 */
81
#define M_PI_2		1.570796326794896619231321691640	/* pi/2 */
82
#endif
82
#endif
83
 
83
 
84
#ifndef M_PI_4
84
#ifndef M_PI_4
85
#define M_PI_4		0.785398163397448309615660845820	/* pi/4 */
85
#define M_PI_4		0.785398163397448309615660845820	/* pi/4 */
86
#endif
86
#endif
87
 
87
 
88
#ifndef M_1_PI		
88
#ifndef M_1_PI
89
#define M_1_PI		0.318309886183790671537767526745	/* 1/pi */
89
#define M_1_PI		0.318309886183790671537767526745	/* 1/pi */
90
#endif
90
#endif
91
 
91
 
92
#ifndef M_2_PI		
92
#ifndef M_2_PI
93
#define M_2_PI		0.636619772367581343075535053490	/* 1/pi */
93
#define M_2_PI		0.636619772367581343075535053490	/* 1/pi */
94
#endif
94
#endif
95
 
95
 
96
#ifndef M_2_SQRTPI
96
#ifndef M_2_SQRTPI
97
#define M_2_SQRTPI	1.128379167095512573896158903122	/* 1/sqrt(pi) */
97
#define M_2_SQRTPI	1.128379167095512573896158903122	/* 1/sqrt(pi) */
Line 238... Line 238...
238
#define	rround	fround
238
#define	rround	fround
239
#define	prec	fprec
239
#define	prec	fprec
240
#undef trunc
240
#undef trunc
241
#define	trunc	ftrunc
241
#define	trunc	ftrunc
242
 
242
 
-
 
243
 
-
 
244
	/* Utilities for `dpq' handling (density/probability/quantile) */
-
 
245
 
-
 
246
#define R_D__0 (give_log ? ML_NEGINF : 0.)
-
 
247
#define R_D__1 (give_log ? 0. : 1.)
-
 
248
#define R_DT_0 (lower_tail ? R_D__0 : R_D__1)
-
 
249
#define R_DT_1 (lower_tail ? R_D__1 : R_D__0)
-
 
250
 
-
 
251
#define R_D_val(x)   (give_log	 ? log(x) : x)	      /*  x  */
-
 
252
#define R_D_log(x)   (give_log	 ?  x	  : exp(x))   /* log(x) */
-
 
253
 
-
 
254
#define R_DT_val(x)  R_D_val(lower_tail ? x	 : 1. - x) /*  x  */
-
 
255
#define R_DT_Cval(x) R_D_val(lower_tail ? 1. - x : x)	   /*  1 - x */
-
 
256
#define R_DT_log(x)  R_D_log(lower_tail ? x	 : 1. - x) /* log(x) */
-
 
257
#define R_DT_Clog(x) R_D_log(lower_tail ? 1. - x : x)	   /* log(1 - x) */
-
 
258
 
-
 
259
#define R_D_give_log(dd)    (((int)dd) >> 1) /* Extract ``give_log'' flag */
-
 
260
#define R_D_lower_tail(dd)  (((int)dd) % 2)  /* Extract ``lower_tail'' flag */
-
 
261
 
-
 
262
	/* R's version of C functions: */
-
 
263
 
-
 
264
double R_log(double x);
-
 
265
double R_pow(double x, double y);
-
 
266
 
243
	/* Machine Characteristics */
267
	/* Machine Characteristics */
244
 
268
 
245
double	d1mach(int);
269
double	d1mach(int);
246
double	d1mach_(int*);
270
double	d1mach_(int*);
247
int	i1mach(int);
271
int	i1mach(int);