VeloDB Cloud 26.x·Apache Doris 4.x (up to 4.0 supported)·"Since X.Y" tags refer to Apache Doris versionsVersion mapping
POW
Description
Returns the value of the first argument raised to the power of the second argument.
Alias
- POWER
- FPOW
- DPOW
Syntax
POW(<a>, <b>)
Parameters
| Parameter | Description |
|---|---|
<a> | Base |
<b> | Power |
Return value
Return an integer type or a floating-point type.
Special cases:
- If a
IS NULLor bIS NULL, returnNULL. - If
b = 0and aIS NOT NULL, it will always return1.
Examples
select pow(2, 0);
+-------------------------------------------+
| pow(cast(2 as DOUBLE), cast(0 as DOUBLE)) |
+-------------------------------------------+
| 1 |
+-------------------------------------------+
select pow(2, 10);
+--------------------------------------------+
| pow(cast(2 as DOUBLE), cast(10 as DOUBLE)) |
+--------------------------------------------+
| 1024 |
+--------------------------------------------+
select pow(1.2, 2);
+---------------------------------------------+
| pow(cast(1.2 as DOUBLE), cast(2 as DOUBLE)) |
+---------------------------------------------+
| 1.44 |
+---------------------------------------------+
select pow(1.2, 2.1);
+-----------------------------------------------+
| pow(cast(1.2 as DOUBLE), cast(2.1 as DOUBLE)) |
+-----------------------------------------------+
| 1.4664951016517147 |
+-----------------------------------------------+
select pow(2, null);
+------------------------------+
| pow(cast(2 as DOUBLE), NULL) |
+------------------------------+
| NULL |
+------------------------------+
select pow(null, 2);
+------------------------------+
| pow(NULL, cast(2 as DOUBLE)) |
+------------------------------+
| NULL |
+------------------------------+