1 import checkedint.sticky : smartOp; // use IntFlagPolicy.sticky 2 3 assert(smartOp.pow(-10, 3) == -1_000); 4 assert(smartOp.pow(16, 4uL) == 65536); 5 assert(smartOp.pow(2, -1) == 0); 6 7 smartOp.pow(-3, 27); 8 assert(IntFlags.local.clear() == IntFlag.negOver); 9 smartOp.pow(0, -5); 10 assert(IntFlags.local.clear() == IntFlag.div0);
Raise base to the exp power.
Errors that may be signalled if neither input is floating-point: