Numerical Recipes is non-portable code

News system news at ism780c.isc.com
Sat Sep 3 08:54:57 AEST 1988


In article <557 at accelerator.eng.ohio-state.edu> rob at kaa.eng.ohio-state.edu (Rob Carriere) writes:
>                                                            There are
>however problems (of a more specialized nature, and the arrays do not
>necessarily model vectors or matrices) where the base does make a
>difference.  I should know, I write the stuff!
>
>
>Rob Carriere

Could you give a small example, perhaps I don't understand. with a
declaration (using an extended version of C):

     int x(5:49),y(0:44);
     int i,k;
     i=6;
     k=x(i);        /* easy to write access to second item */
     k=y(i-5);      /* more trouble to write access to second item */

However, with a reasonable compiler, both assignments to k will generate
identical code.  Your compiler may vary :-).  But if you are writing time
critical code with a faulty compiler, I guess you do what you can.

     Marv Rubinstein



More information about the Comp.lang.c mailing list