"Numerical Recipes in C" is nonportable code

Peter da Silva peter at ficc.uu.net
Sun Sep 25 01:11:52 AEST 1988


In article <21058 at watmath.waterloo.edu>, atbowler at watmath.waterloo.edu (Alan T. Bowler [SDG]) writes:
> In article <531 at accelerator.eng.ohio-state.edu> rob at kaa.eng.ohio-state.edu (Rob Carriere) writes:
> >Gentlemen >system programmers, surely you too have algorithms that are
> >more accurately expressed with arrays from other than base zero?

  [ complaints from programmers ]
> and numerical analysts was about how awkward it was to code algorithms
> in Fortran-IV because it used origin 1 indexing and origin 0 would
> clearly have been so much more "natural".

Most cases 0 is more natural. For some cases 1 is more natural. For other
cases -63 might be more natural. and for others 7 might be the best base.

Fortran now allows these other bases (we use a lot of 0-based arrays here).
'C' doesn't. There is some question whether it should.
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?"            peter at ficc.uu.net



More information about the Comp.lang.c mailing list