FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions.

Pow

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

Pow( value, exponent)
pow( value, exponent)
Pow( value, exponent)
Pow( value, exponent)
Pow( value, exponent)

Description

The Pow function raises its first numeric argument, the base, to the power of its second numeric argument, the exponent.

Parameters

Parameter Type Definition and Requirements

base

Number

The base.

exponent

Number

The exponent.

Returns

The result of raising a number (base) to the power of another number (exponent).

Examples

client.query(
  [
    q.Pow(2, 3),
    q.Pow(5, 2),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
[ 8, 25 ]
result = client.query(
  [
    q.pow(2, 3),
    q.pow(5, 2),
  ]
)
print(result)
[8.0, 25.0]
result, err := client.Query(
	f.Arr{
		f.Pow(2, 3),
		f.Pow(5, 2),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[8 25]
try
{
    Value result = await client.Query(
        Arr(
            Pow(2, 3),
            Pow(5, 2)
        )
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
Arr(DoubleV(8), DoubleV(25))
[
  Pow(2, 3),
  Pow(5, 2),
]
[ 8, 25 ]
Query metrics:
  •    bytesIn:  37

  •   bytesOut:  23

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 5ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!