Mathematical Constants

Mathematical constants

Mathematical constants

All values derived internally by the boring_math.special_functions.constants module itself.

  • infinity

  • e

  • pi

boring_math.special_functions.constants.infinity: complex = (inf+infj)

Single complex infinity

Used as a sentinel value to represent of a single complex infinity.

Note

Complex infinity is a mathematical concept. Python does not natively support inf+infj for this.

  • Complex functions will return positive inf to represent complex infinity.

  • Functions returning Float will use +inf and -inf when one and two sided infinite limits exist.

Tip

Use the cmath.isinf function to test for infinite values.

boring_math.special_functions.constants.e: float = 2.718281828459045

Base of the natural logarithms

Also the limit of (1 + 1/n)ⁿ as n .

boring_math.special_functions.constants.pi: float = 3.141592653589793

Ratio circle’s circumference to diameter.

π can also be defined as the smallest positive real value x where either

  • e²ˣⁱ = 1

  • sin(x/2) = 1

Note

This value for π is based on a continued fraction expansion due to Bill Gosper.

π = 4/(1 + 1²/(3 + 2²/(5 + 3²/(7 + 4²/(9 + 5²/(11 + ...))))))