--- ray/src/common/color.c 1989/02/02 10:34:29 1.1 +++ ray/src/common/color.c 1989/05/11 22:15:57 1.4 @@ -289,7 +289,7 @@ double r, g, b; d = r > g ? r : g; if (b > d) d = b; - if (d <= 0.0) { + if (d <= 1e-32) { clr[RED] = clr[GRN] = clr[BLU] = 0; clr[EXP] = 0; return; @@ -313,39 +313,9 @@ register COLR clr; if (clr[EXP] == 0) col[RED] = col[GRN] = col[BLU] = 0.0; else { - f = ldexp(1.0, clr[EXP]-(COLXS+8)); + f = ldexp(1.0, (int)clr[EXP]-(COLXS+8)); col[RED] = (clr[RED] + 0.5)*f; col[GRN] = (clr[GRN] + 0.5)*f; col[BLU] = (clr[BLU] + 0.5)*f; } } - - -#ifdef FREXP -double -frexp(x, ip) /* call it paranoia, I've seen the lib version */ -register double x; -int *ip; -{ - int neg; - register int i; - - if (neg = (x < 0.0)) - x = -x; - else if (x == 0.0) { - *ip = 0; - return(0.0); - } - if (x < 0.5) - for (i = 0; x < 0.5; i--) - x *= 2.0; - else - for (i = 0; x >= 1.0; i++) - x /= 2.0; - *ip = i; - if (neg) - return(-x); - else - return(x); -} -#endif