Pow operator precedence

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Fri Jan 13 05:10:17 PST 2012


the problem is, that there are two popular use cases of this
expression. One is plain old power expression and the other is writing
scientific notations of numbers. I thing we should stick with the
first use case, because at least for literals we already have
scientific notation.

On Fri, Jan 13, 2012 at 4:48 PM, bearophile <bearophileHUGS at lycos.com> wrote:
> This is the third time I see people trip on power operator precedence:
> http://d.puremagic.com/issues/show_bug.cgi?id=7268
>
> Some people expect this:
> (-10 ^^ 2)
> To be 100 instead of -100
> (Note: Python here uses the same operator precedences.)
>
> Do you think it's worth (and possible) to help D programmers avoid this mistake in their code?
>
> Bye,
> bearophile



-- 
Bye,
Gor Gyolchanyan.


More information about the Digitalmars-d mailing list