```\n// x ^ n\n// NOTE: n is a normal integer, do not shift 18 decimals\n// solium-disable-next-line security/no-assign-params\nfunction wpowi(int256 x, int256 n) internal pure returns (int256 z) {\n    z = n % 2 != 0 ? x : \_WAD;\n\n    for (n /= 2; n != 0; n /= 2) {\n        x = wmul(x, x);\n\n        if (n % 2 != 0) {\n            z = wmul(z, x);\n        }\n    }\n}\n```\n