summaryrefslogtreecommitdiffstats
path: root/lib/ansible/plugins/filter/pow.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /lib/ansible/plugins/filter/pow.yml
parentInitial commit. (diff)
downloadansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz
ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/plugins/filter/pow.yml')
-rw-r--r--lib/ansible/plugins/filter/pow.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/pow.yml b/lib/ansible/plugins/filter/pow.yml
new file mode 100644
index 0000000..da2fa42
--- /dev/null
+++ b/lib/ansible/plugins/filter/pow.yml
@@ -0,0 +1,34 @@
+DOCUMENTATION:
+ name: pow
+ version_added: "1.9"
+ short_description: power of (math operation)
+ description:
+ - Math operation that returns the Nth power of inputed number, C(X ^ N).
+ notes:
+ - This is a passthrough to Python's C(math.pow).
+ positional: _input, _power
+ options:
+ _input:
+ description: The base.
+ type: float
+ required: true
+ _power:
+ description: Which power (exponent) to use.
+ type: float
+ required: true
+
+EXAMPLES: |
+
+ # => 32768
+ eight_power_five: "{{ 8 | pow(5) }}"
+
+ # 4
+ square_of_2: "{{ 2 | pow(2) }}"
+
+ # me ^ 3
+ cube_me: "{{ me | pow(3) }}"
+
+RETURN:
+ _value:
+ description: Resulting number.
+ type: float