ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/color.c
(Generate patch)

Comparing ray/src/common/color.c (file contents):
Revision 1.2 by greg, Wed Mar 15 13:48:37 1989 UTC vs.
Revision 1.3 by greg, Thu May 11 21:22:38 1989 UTC

# Line 319 | Line 319 | register COLR  clr;
319                  col[BLU] = (clr[BLU] + 0.5)*f;
320          }
321   }
322
323
324 #ifdef  FREXP
325 double
326 frexp(x, ip)            /* call it paranoia, I've seen the lib version */
327 register double  x;
328 int  *ip;
329 {
330        int  neg;
331        register int  i;
332
333        if (neg = (x < 0.0))
334                x = -x;
335        else if (x == 0.0) {
336                *ip = 0;
337                return(0.0);
338        }
339        if (x < 0.5)
340                for (i = 0; x < 0.5; i--)
341                        x *= 2.0;
342        else
343                for (i = 0; x >= 1.0; i++)
344                        x /= 2.0;
345        *ip = i;
346        if (neg)
347                return(-x);
348        else
349                return(x);
350 }
351 #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines