# Constants like e and eulergamma in Julia V1.0 no longer available?

**URL:** <https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917>\
**Category:** General Usage\
**Created:** [October 5, 2018, 8:16am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917 "2018-10-05T08:16:06Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 5, 2018, 8:16am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/1 "2018-10-05T08:16:06Z")

</div>

Hello,  
I am currently working my way through the Julia documentation and the examples and stumble over the Euler number e. In Julia V0.6 I could still call them, but in Julia V1.0.1 I get the message “ERROR: UndefVarError: e not defined”. Does this constant no longer belong to the Julia base, is the documentation no longer correct?

Thanks for any hint!

Regards,  
Guenter

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [October 5, 2018, 8:18am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/2 "2018-10-05T08:18:27Z")

</div>

If you use version 0.7, you can get helpful deprecations messages for these kinds of problems. Here’s what happens in version 0.7:

```julia
julia> e
WARNING: Base.e is deprecated, use ℯ (\euler) or `Base.MathConstants.e`
 in module Main
ℯ = 2.7182818284590...

```

Every time you stumble across functionality that is missing from previous version of Julia, just open v0.7.

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [October 5, 2018, 8:30am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/3 "2018-10-05T08:30:54Z")

</div>

Searching for `euler` does not give any result in the documentation.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [October 5, 2018, 8:48am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/4 "2018-10-05T08:48:24Z")

</div>

Ha, yes it’s because the word “Euler” doesn’t appear on its own… 🙂 You can search for

```julia
euler'

```

which finds it in `Euler's constant`.

(or `eulergamma`…)

But there’s plenty of room for improvement…

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [October 5, 2018, 8:48am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/5 "2018-10-05T08:48:31Z")

</div>

```julia
julia> apropos("euler")
Base.MathConstants.eulergamma
Base.MathConstants.γ
SpecialFunctions.cosint

```

gives at least some hint ^^

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 5, 2018, 9:02am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/6 "2018-10-05T09:02:57Z")

</div>

Yes, that’s right. But the attempt to rework the documentation is not successful (possibly a language problem for me) because the example no longer works under V1.0:

```julia
julia> e
e = 2.7182818284590...

```

But _julia\> MathConstants.e_ works! Thank you for this hint!  
Cheers,  
Guenter

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [October 5, 2018, 9:22am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/7 "2018-10-05T09:22:11Z")

</div>

If an answer has solved your problem, please mark it as ‘solved’ so people know that your question has been answered 🙂

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [October 5, 2018, 10:01am UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/8 "2018-10-05T10:01:41Z")

</div>

@Gunter_Faes: can you please link the the doc-example in question?

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 5, 2018, 5:41pm UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/9 "2018-10-05T17:41:55Z")

</div>

Hi mauro3

here the [Link](https://docs.julialang.org/en/v1/base/numbers/#Base.MathConstants.pi). This is pi but the next example is e. But I am very happy to see that someone is working on the documentary. The example for the constant catalan has been adapted! 😀

Regrads,  
Guenter

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [October 5, 2018, 6:27pm UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/10 "2018-10-05T18:27:50Z")

</div>

But in that example, you get the italics _e_, which does work just like that:

```julia
julia> ℯ # type \euler+tab to get it                                                                                                                                                          
ℯ = 2.7182818284590...                                                                                                                                                  

```

also copy paste from the docs works for me. Admittedly it’s a bit hard to spot the difference between e and _e_.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 5, 2018, 6:48pm UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/11 "2018-10-05T18:48:03Z")

</div>

Hi Mauro,

Yeah, that sounds pretty weird! In version 0.6 the “quite normal” e works. I don’t think the implementation under V1.0 is well solved from the IT point of view! 🤔

Cheers,

Guenter

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [October 5, 2018, 6:55pm UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/12 "2018-10-05T18:55:27Z")

</div>

Don’t panic! It’s all still there and the defaults are pretty reasonable. 🙂.

In `Base`, `π` is still there. `e` is no longer the Euler number, but `ℯ` (`\euler`) is and it’s still exported by `Base`.

For other stuff you can do e.g.

```julia
using .MathConstants: γ

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [October 5, 2018, 8:03pm UTC](https://discourse.julialang.org/t/constants-like-e-and-eulergamma-in-julia-v1-0-no-longer-available/15917/13 "2018-10-05T20:03:23Z")

</div>

`e` was considered too common a variable name to assign by default, particularly in situations like this:

```julia
julia> try
        error()
        catch
        @show e
        end
e = ℯ = 2.7182818284590...

```

(people often use `e` for the exception object so if they forgot it on the catch they kept logging/showing Euler’s constant). The unicode version (\euler) was not considered too short, so that export was kept. If you want the ASCII export, you can put `using Base.MathConstants` at the top of your function.
