Stay organized with collections
Save and categorize content based on your preferences.
math.pow
math.pow(base, exponent)
Description
Returns the value of the first arg raised to the power of the second arg. Returns 0 in case of overflow.
Param data types
base: INT|FLOAT
exponent: INT|FLOAT
Return type
FLOAT
Code samples
Example 1
This example shows an integer case.
math.pow(2, 2) // 4.00
Example 2
This example shows a fraction base case.
math.pow(2.200000, 3) // 10.648
Example 3
This example shows a fraction base and power case.
math.pow(2.200000, 1.200000) // 2.575771
Example 4
This example shows a negative power case.
math.pow(3, 0-3) // 0.037037
Example 5
This example shows a fraction power case.
math.pow(3, 0-1.200000) // 0.267581
Example 6
This example shows a negative base case.
math.pow(0-3, 0-3) // -0.037037
Example 7
This example shows a zero base case.
math.pow(0, 3) // 0
Example 8
This example shows a zero power case.
math.pow(9223372036854775807, 0) // 1
Example 9
This example shows a large base case.
math.pow(9223372036854775807, 1.200000) // 57262152889751593549824
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003emath.pow(base, exponent)\u003c/code\u003e calculates the result of raising the \u003ccode\u003ebase\u003c/code\u003e to the power of the \u003ccode\u003eexponent\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003ebase\u003c/code\u003e and \u003ccode\u003eexponent\u003c/code\u003e can be either \u003ccode\u003eINT\u003c/code\u003e or \u003ccode\u003eFLOAT\u003c/code\u003e data types, and the function returns a \u003ccode\u003eFLOAT\u003c/code\u003e value.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns \u003ccode\u003e0\u003c/code\u003e if the operation results in an overflow condition.\u003c/p\u003e\n"],["\u003cp\u003eThe function works with a variety of parameters, such as fractional and negative exponents and negative bases.\u003c/p\u003e\n"],["\u003cp\u003eThe function can also handle cases where the base is zero or the exponent is zero.\u003c/p\u003e\n"]]],[],null,["### math.pow\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n math.pow(base, exponent)\n\n#### Description\n\nReturns the value of the first arg raised to the power of the second arg. Returns 0 in case of overflow.\n\n#### Param data types\n\nbase: `INT|FLOAT`\nexponent: `INT|FLOAT`\n\n#### Return type\n\n`FLOAT`\n\n#### Code samples\n\n##### Example 1\n\nThis example shows an integer case. \n\n math.pow(2, 2) // 4.00\n\n##### Example 2\n\nThis example shows a fraction base case. \n\n math.pow(2.200000, 3) // 10.648\n\n##### Example 3\n\nThis example shows a fraction base and power case. \n\n math.pow(2.200000, 1.200000) // 2.575771\n\n##### Example 4\n\nThis example shows a negative power case. \n\n math.pow(3, 0-3) // 0.037037\n\n##### Example 5\n\nThis example shows a fraction power case. \n\n math.pow(3, 0-1.200000) // 0.267581\n\n##### Example 6\n\nThis example shows a negative base case. \n\n math.pow(0-3, 0-3) // -0.037037\n\n##### Example 7\n\nThis example shows a zero base case. \n\n math.pow(0, 3) // 0\n\n##### Example 8\n\nThis example shows a zero power case. \n\n math.pow(9223372036854775807, 0) // 1\n\n##### Example 9\n\nThis example shows a large base case. \n\n math.pow(9223372036854775807, 1.200000) // 57262152889751593549824"]]