As a Mathematician I would like:

Stephen Montgomery-Smith stephen at math.missouri.edu
Fri Jun 29 19:10:15 PDT 2007


Don Clugston wrote:
> Stephen Montgomery-Smith wrote:
>> If I had two changes I would make to the C programming language, it is
>>
>> 1. Put in an exponentiation operator, a^b or a**b, so that 2**3 is 8. 
>> For a numerics programmer this would be really useful. This is one way 
>> that Fortran really scores over C. I know that there is the pow 
>> function in C, but it always treats the power as a float or double, 
>> where if the power is an integer it should really work differently.
> Actually pow() does work differently for integers.
>> Also the optimization should be able to do clever things with a^2 
>> (i.e. write it as inline code a*a).

If I write a = pow(x,5.0), would a typical modern compiler produce 
inline code something like
b=x*x;
a=b*b*x?
If this is so, that is really neat!!!



More information about the Digitalmars-d mailing list