Skip to content

log

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 L(logarithm, https://en.wikipedia.org/wiki/Logarithm) to base N of the input number.
  • By default, computes the L(natural logarithm, https://en.wikipedia.org/wiki/Natural_logarithm).

Parameters

Parameter Defaults / Choices Comments
_input
float
required
Number to operate on.
base
float
Default: 2.718281828459045
Which base to use. Defaults to L(Euler's number, https://en.wikipedia.org/wiki/Euler%27s_number).

Notes

Note

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

Examples

# 1.2920296742201791
eightlogfive: "{{ 8 | log(5) }}"

# 0.9030899869919435
eightlog10: "{{ 8 | log() }}"

Return Values

Key Data Type Description Returned
_value float Resulting number.