Re: mainly syntax
- Posted by "Harris, Greg" <gharris at NAROYAL.COM> Feb 18, 1998
- 777 views
Hello all, >I don't understand the problem with zero - based vs 1 - based indexing, >unless you're trying to use basic code without re-writing. Why would >there be any reason to continually adjust the index s[x-1] ? >What's wrong with calling the first item [1] and the second item [2]...etc.? In real world situations, i.e. memory addressing, certain mathematics, etc., 0 indexing is used quite a bit. The raycaster demo and the mode19 engine (no plug intended) has to use a lot of x+1 to get the indexing to work out right in lookup tables. Cos(), Sin(), Tan(), etc. start a 0 not 1. Binary data starts at 0. Most of your algorithms are based on 0 reference. Having to add 1 can be a pain and adds unneeded additions (lots of them in loops). I would like to see a "Option Base" or similar so you can start at 1 or 0. IMHO, Greg Harris blackdog at cdc.net Check out the Euphoria Consortium at: http://frontpage.cdc.net/blackdog Under Construction!!