Disclaimer: I do not know D. This is written by my background using other languages.
By squaring a negative (real) number, the number becomes positive. You write an ambiguous expression (for people):
-3^2
This could mean either:
Judging by the conclusions, I assume that the first chooses the priority of the programming language operator. Try replacing the last line:
writeln((-3.0L) ^^ 2.0L);
source
share