Knowing which is faster, and thus using proper optimization, could possibly speed up some of my graphics processing routines, which depend on processing MANY input values in as short a time as possible.
Is significantly faster (empherical measurement - I generated 1,000,000 random numbers (Singles) between 1 and 99 and used both methods to square.
Exponentiation gave 0.3125 Secs, Multiplication gave 0.0468 Secs)
When it comes to optimisation, the circumstances can be extremely important... and this is one of those cases where it is more likely than most.
It could be significantly faster still to use either method for the calculation, but simply do it in advance and store the results to an array which you read from later. Of course that only works if you know that there is only a particular range of values that oldval can be (such as integers from -255 to +255).