import checkedint.sticky : safeOp; // use IntFlagPolicy.sticky assert(safeOp.pow(-10, 3) == -1_000); static assert(!__traits(compiles, safeOp.pow(16, 4uL))); safeOp.pow(2, -1); assert(IntFlags.local.clear() == IntFlag.undef); safeOp.pow(-3, 27); assert(IntFlags.local.clear() == IntFlag.negOver); safeOp.pow(0, -5); assert(IntFlags.local.clear() == IntFlag.undef);
Raise base to the exp power.
Errors that may be signalled if neither input is floating-point: