hirsch@pioneer.arc.nasa.gov (Bob Hirsch) (03/02/91)
We seem to have a local argument about whether multiplying by unity (or adding zero) is executed faster than multiplying or adding with arbitrary values. The relevant environment is VAX VMS 5.x, VAX Fortran. The values appear in ordinary variables assigned at run time, not as parameters or by DATA statements. Theory "A" suggests that the computer can plainly tell that the multiplier has a value of one and can therefore save time by treating the command as a no-op. Theory "B" claims that applying the above test for every multiply operation ever performed would be far more costly than the saving obtained on the rare occasions when it applied. I'm not asking for votes on which theory you prefer, but I am asking if anyone *knows with certainty* whether there is any difference for operations with one and zero. How about e-mail, and I'll summarize? Thanks, Bob Hirsch -- Sterling ZeroOne -- NASA Ames Research Center hirsch@ames.arc.nasa.gov Mail Stop 233-3 415/604-4807 Moffett Field, CA 94035 **The preceding has been an opinion by a concerned citizen.**