RosettaCodeData/Task/Exponentiation-order/D/exponentiation-order.d
2023-07-01 13:44:08 -04:00

8 lines
305 B
D

void main() {
import std.stdio, std.math, std.algorithm;
writefln("5 ^^ 3 ^^ 2 = %7d", 5 ^^ 3 ^^ 2);
writefln("(5 ^^ 3) ^^ 2 = %7d", (5 ^^ 3) ^^ 2);
writefln("5 ^^ (3 ^^ 2) = %7d", 5 ^^ (3 ^^ 2));
writefln("[5, 3, 2].reduce!pow = %7d", [5, 3, 2].reduce!pow);
}