Path: utzoo!utgpu!news-server.csri.toronto.edu!me!zougas Newsgroups: comp.lang.c From: zougas@me.utoronto.ca ("Athanasios(Tom) Zougas") Subject: Re: a style question Message-ID: <90Oct1.102559edt.18827@me.utoronto.ca> Organisation: U of Toronto, Dept. of Mechanical Engineering Organization: Mechanical Engineering, U of Toronto References: <7341@darkstar.ucsc.edu> <1990Sep30.050655.13212@zoo.toronto.edu> <1990Sep30.172917.2951@Neon.Stanford.EDU> Date: 1 Oct 90 14:26:04 GMT davis@pacific.mps.ohio-state.edu ("John E. Davis") writes: >In article <1990Sep30.172917.2951@Neon.Stanford.EDU> kanamori@Neon.Stanford.EDU (Atsushi Kanamori) writes: > >More usefully, "<" seems to be a more common idiom than "!=" in upward counting > >loops. So using "<" will probably shave a few microseconds off > >the human reader's processing time. >Which generates faster code? It seems to me that it is easier to tell if two >values are unequal than to tell if one is greater than the other. I'd rather >save the machine a few micro-seconds than myself since I only do the >comparison once whereas the machine must do it many times. You know what they say: "Computers are very good at doing things over and over and over again":-) Shaving microseconds does not make better code. Better algorithms do. (Definition of 'better' left to the reader as an exercise :-) Tom. -- I can be reached at... zougas@me.utoronto.ca || zougas@me.toronto.edu || ...!utai!me!zougas