Exponential operator

Michel Fortin michel.fortin at michelf.com
Fri Aug 7 09:57:12 PDT 2009


On 2009-08-07 12:33:09 -0400, Miles <_______ at _______.____> said:

> Lars T. Kyllingstad wrote:
>> Neither of the natural candidates, a^b and a**b, are an option, as they
>> are, respectively, already taken and ambiguous.
> 
> I think that a ** b can be used, is not ambiguous except for the
> tokenizer of the language. It is the same difference you have with:
> 
>   a ++ b  -> identifier 'a', unary operator '++', identifier 'b' (not
> parseable)
> 
>   a + + b  -> identifier 'a', binary operator '+', unary operator '+',
> identifier 'b' (parseable)

But to be coherent with a++ which does a+1, shouldn't a** mean a to the 
power 1 ?

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list