Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: "Kevin G. Rhoads" <T_Rhoads@NoSpam.CLASSIC.MSN.COM>
Subject: Re: a**2 or a*a
Date: 1998/01/14	[thread overview]
Message-ID: <01bd2110$37868cc0$LocalHost@stupidwin95> (raw)
In-Reply-To: 34BCC4A4.F27A00D1@cranfield.ac.uk


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



  parent reply	other threads:[~1998-01-14  5:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-14  5:00 a**2 or a*a Yon Han CHONG
1998-01-14  5:00 ` Arnaud Desitter
1998-01-15  5:00   ` Robert Corbett
1998-01-14  5:00 ` Kevin G. Rhoads [this message]
1998-01-14  5:00   ` Ed Overman
1998-01-14  5:00 ` Phillip Helbig
1998-01-14  5:00 ` Peter Shenkin
1998-01-15  5:00 ` Nick Wagg
1998-01-15  5:00 ` Steve Lionel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox