CKTIS / Python
math.e
Supplies a floating-point approximation to the base of the natural logarithm.
Version: Python 3.14; repository image, production runtime not attested
Syntax
math.eSupplies a floating-point approximation to the base of the natural logarithm.
The constant has finite precision. Its natural logarithm is one to the precision shown here.
This float approximates Euler’s number, the base of exponential growth at unit continuous rate. Rounding for display gives 2.718282. Taking the natural logarithm yields 1.0 at working precision; storing the float does not encode the infinite decimal expansion.
import math
assert isinstance(math.e, float) and 2.71 < math.e < 2.72
assert math.isclose(math.log(math.e), 1.0)
Examples
import math
print(round(math.e, 6))
print(math.log(math.e))
Result
2.718282 1.0
This float approximates Euler’s number, the base of exponential growth at unit continuous rate. Rounding for display gives 2.718282. Taking the natural logarithm yields 1.0 at working precision; storing the float does not encode the infinite decimal expansion.