Skip to content

pow

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 1.9.

Synopsis

  • Math operation that returns the Nth power of inputted number, C(X ^ N).

Parameters

Parameter Defaults / Choices Comments
_input
float
required
The base.
_power
float
required
Which power (exponent) to use.

Notes

Note

  • This is a passthrough to Python's C(math.pow).

Examples

# => 32768
eight_power_five: "{{ 8 | pow(5) }}"

# 4
square_of_2: "{{ 2 | pow(2) }}"

# me ^ 3
cube_me: "{{ me | pow(3) }}"

Return Values

Key Data Type Description Returned
_value float Resulting number.