{"ScriptPreparationCode":"function powNaive(x, y) {\r\n\tif (!y) return 1;\r\n\tlet tmp = x;\r\n\tfor (let i = 1; i \u003C y; i\u002B\u002B) {\r\n\t\ttmp *= x;\r\n \t}\r\n\treturn tmp;\r\n}\r\n\r\n// from https://codereview.stackexchange.com/a/217369\r\nfunction pow2B(x, y) {\r\n if (y \u003C 2) { return y ? x : 1 }\r\n if (y \u0026 1) { return x * pow2B(x, y \u0026 0x7FFFFFFE)}\r\n const p = pow2B(x, y \u003E\u003E 1);\r\n return p * p;\r\n}\r\n\r\n// other two functions from the same stackexchange post\r\nfunction pow(x, y) {\r\n if (!y) { return 1 }\r\n let tmp = res = x;\r\n for (let i = 1; i \u003C y; i\u002B\u002B) {\r\n for (let j = 1; j \u003C x; j\u002B\u002B) { tmp \u002B= res }\r\n res = tmp;\r\n }\r\n return res;\r\n}\r\n\r\nfunction pow2(x, y) {\r\n if (!y) { return 1; }\r\n if (y % 2) {\r\n return x * pow2(x, y - 1);\r\n }\r\n const p = pow2(x, y/2);\r\n return p * p;\r\n}","TestCases":[{"Name":"Math.pow","Code":"var x = Math.pow(54,2);","IsDeferred":false},{"Name":"pow2 bitwise","Code":"var y = pow2B(54, 2)","IsDeferred":false},{"Name":"pow2 summ","Code":"var y = pow(54, 2)","IsDeferred":false},{"Name":"pow2 multi","Code":"var y = pow2(54, 2)","IsDeferred":false},{"Name":"pow (mult for loop)","Code":"var y = powNaive(54, 2)","IsDeferred":false}]}