Skip to content

Math constants

What it does: Inserts known constants.

constants

Constants

  • PI, E, GOLDEN_RATIO, SQRT2, SQRT1_2, INFINITY

Output

  • NUMBER

Example

Circumference o = 2 π (3.14) × radius r

circumference calculation

Tips

  • For constants other than INFINITY, the generator adds import math and uses math.*.
  • INFINITY is generated as float('inf') in Python.