--- ray/src/common/dircode.c 2003/03/04 19:02:47 2.2 +++ ray/src/common/dircode.c 2003/06/07 12:50:20 2.4 @@ -1,8 +1,10 @@ #ifndef lint -static const char RCSid[] = "$Id: dircode.c,v 2.2 2003/03/04 19:02:47 greg Exp $"; +static const char RCSid[] = "$Id: dircode.c,v 2.4 2003/06/07 12:50:20 schorsch Exp $"; #endif /* - * Compute 4-byte direction code (assume this fits into int) + * Compute a 4-byte direction code (int4 type defined in standard.h). + * + * Mean accuracy is 0.0022 degrees, with a maximum error of 0.0058 degrees. */ #include "standard.h" @@ -27,10 +29,10 @@ FVECT dv; for (i = 0; i < 3; i++) if (dv[i] < 0.) { - cd[i] = dv[i] * -DCSCALE; + cd[i] = (int)(dv[i] * -DCSCALE); dc |= FXNEG<