From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,f8f184f3bc3517df X-Google-Attributes: gidfc89c,public X-Google-Thread: f678f,f8f184f3bc3517df X-Google-Attributes: gidf678f,public X-Google-Thread: 1094ba,f8f184f3bc3517df X-Google-Attributes: gid1094ba,public From: "Kevin G. Rhoads" Subject: Re: a**2 or a*a Date: 1998/01/14 Message-ID: <01bd2110$37868cc0$LocalHost@stupidwin95>#1/1 X-Deja-AN: 315902059 References: <34BCC4A4.F27A00D1@cranfield.ac.uk> Newsgroups: comp.lang.fortran,comp.unix.osf.misc,comp.unix.programmer Before optimizing compilers and coprocessor hardware, a*a was normally recommend over a**2. However, that isn't necessarily true now. The best way to answer this question, write it both ways in test program(s) and time it. With compiler optimizations turned off you can get an accurate idea of what the underlying hardware likes. With optimizations turned on, your code has to be structured to avoid getting optimized out of existence. Fill a large array with values, and loop over that. On x86 platforms w/ 87 coprocessors the answer to the above tends to be different than w/o a coprocessor -- similarly, the answer for integer multiplication in the x86 vs. integers loaded into the 87 are often different. On other platforms, there will be similar variations. -- Kevin G. Rhoads, Ph.D. T_Rhoads@NO_SPAM.Classic.MSN.COM