Skip to content

Commit b1a500e

Browse files
committed
add exp(-1) constant
useful in many situations, also -exp(-1) is the branching point of Lambert's W_0(t) and W_{-1}(t)
1 parent d226b95 commit b1a500e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/IrrationalConstants.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export
2626
logten, # log(10)
2727
logπ, # log(π)
2828
log2π, # log(2π)
29-
log4π # log(4π)
29+
log4π, # log(4π)
30+
invℯ # 1 / ℯ
3031

3132
include("stats.jl")
3233

src/stats.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@
2828
@irrational logπ 1.1447298858494001741 log(big(π))
2929
@irrational log2π 1.8378770664093454836 log(2 * big(π))
3030
@irrational log4π 2.5310242469692907930 log(4 * big(π))
31+
32+
@irrational invℯ 0.367879441171442321595 inv(big(ℯ))

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ end
4040
@test isapprox(log(4pi), log4π)
4141
end
4242

43+
@testset "1/e" begin
44+
@test isapprox(invℯ, exp(-1))
45+
end

0 commit comments

Comments
 (0)