"Numerical Recipes in C" is nonportable code

Vidhyanath K. Rao vkr at osupyr.mast.ohio-state.edu
Sat Sep 3 04:57:29 AEST 1988


In article <8400 at smoke.ARPA>, gwyn at smoke.ARPA (Doug Gwyn ) writes:
> I've known mathematicians who have switched over to starting
> enumerating at 0 instead of 1.  They argued that THAT was "more
> natural".  One can certainly get used to either convention.

A mathematician is one who starts counting at 0 :-)
Historically, people were suspicious of 'nothing' which is why 0 was not
a number by itself (as opposed to being used in place value notation) till
about 6th century A.D.
As far as indexing goes where one starts makes a difference in terms of
typography :-) More seriously, one may have several things to be indexed,
over a big range (-infinity to infinity even) and each thing is indexed
over some subrange not starting at 0. Changing every origin to 0 is
painful and likely to lead to bugs. Ideally this must be fixed up at the
preprocessor level than at code level. Anybody want to write these
macros?
-Nath
vkr at osupyr.mast.ohio-state.edu



More information about the Comp.lang.c mailing list