Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 1/e constant #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/IrrationalConstants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export
logten, # log(10)
logπ, # log(π)
log2π, # log(2π)
log4π # log(4π)
log4π, # log(4π)
invℯ, inve # 1 / ℯ

include("stats.jl")

Expand Down
3 changes: 3 additions & 0 deletions src/stats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
@irrational logπ 1.1447298858494001741 log(big(π))
@irrational log2π 1.8378770664093454836 log(2 * big(π))
@irrational log4π 2.5310242469692907930 log(4 * big(π))

@irrational invℯ 0.367879441171442321595 inv(big(ℯ))
const inve = invℯ # ASCII alias
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ end
@test isapprox(log(4pi), log4π)
end

@testset "1/e" begin
@test isapprox(invℯ, exp(-1))
@test isapprox(inve, exp(-1))
end