我正在浏览gamma()
指向这个 C 源文件的函数的 R 源代码。
代码片段如下:
#ifdef NOMORE_FOR_THREADS
static int ngam = 0;
static double xmin = 0, xmax = 0., xsml = 0., dxrel = 0.;
/* Initialize machine dependent constants, the first time gamma() is called.
FIXME for threads ! */
if (ngam == 0) {
ngam = chebyshev_init(gamcs, 42, DBL_EPSILON/20);/*was .1*d1mach(3)*/
gammalims(&xmin, &xmax);/*-> ./gammalims.c */
xsml = exp(fmax2(log(DBL_MIN), -log(DBL_MAX)) + 0.01);
/* = exp(.01)*DBL_MIN = 2.247e-308 for IEEE */
dxrel = sqrt(DBL_EPSILON);/*was sqrt(d1mach(4)) */
}
#else
/* For IEEE double precision DBL_EPSILON = 2^-52 = 2.220446049250313e-16 :
* (xmin, xmax) are non-trivial, see ./gammalims.c
* xsml = exp(.01)*DBL_MIN
* dxrel = sqrt(DBL_EPSILON) = 2 ^ -26
*/
# define ngam 22
# define xmin -170.5674972726612
# define xmax 171.61447887182298
# define xsml 2.2474362225598545e-308
# define dxrel 1.490116119384765696e-8
#endif
现在我明白这段代码正在初始化变量的值,如ngam
,xsml
等dxrel
。但我不明白什么是NOMORE_FOR_THREADS
.
我找不到它的定义位置,所以我很困惑它什么时候会进入#ifdef
子句,或者只是进入#else
子句并根据 IEEE 标准定义变量。
如果有人可以阐明定义的内容NOMORE_FOR_THREADS
或定义的位置,那将非常有帮助。
谢谢您的帮助。