# Vector as exponent with the Euler's number basis

**URL:** https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074
**Category:** New to Julia
**Created:** [July 11, 2022, 9:45pm UTC](https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074 "2022-07-11T21:45:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tapyu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tapyu/32/37182_2.png) [@tapyu](https://discourse.julialang.org/u/tapyu)
#### Post date: [July 11, 2022, 9:45pm UTC](https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074/1 "2022-07-11T21:45:30Z")

</div>

That is a very basic question. In Matlab, we can pass a vector for the `exp` function and it returns a vector with the exponential results.

In Julia, I can’t do that since `exp` does not allow a vector as input. Plus, I can’t do `e.^v` since the Euler’s number is not defined. How to solve it?

---

<div class="post-metadata">

### Author: ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)
#### Post date: [July 11, 2022, 9:47pm UTC](https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074/2 "2022-07-11T21:47:33Z")

</div>

```julia
julia> exp.(rand(10))
10-element Vector{Float64}:
 1.5873169230522923
 1.7204554407302755
 1.9840565297531094
 2.7057478585870305
 1.3102571943681591
 1.9628991834318725
 1.2499693417272832
 1.7896481387376577
 1.23080464883015
 1.4771492869804266

```

---

<div class="post-metadata">

### Author: ![StevenWhitaker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevenwhitaker/32/9749_2.png) [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)
#### Post date: [July 12, 2022, 1:03pm UTC](https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074/3 "2022-07-12T13:03:53Z")

</div>

> [@tapyu](#):
>
> I can’t do `e.^v` since the Euler’s number is not defined.

For the record, Euler’s number is bound to `ℯ` (i.e., `\euler<TAB>`). So you can do

```julia
julia> ℯ.^[1,2,3]
3-element Vector{Float64}:
  2.718281828459045
  7.38905609893065
 20.085536923187668

```

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [July 12, 2022, 1:07pm UTC](https://discourse.julialang.org/t/vector-as-exponent-with-the-eulers-number-basis/84074/4 "2022-07-12T13:07:51Z")

</div>

> [@tapyu](#):
>
> In Julia, I can’t do that since `exp` does not allow a vector as input.

See also [this section of the manual](https://docs.julialang.org/en/v1/manual/functions/#man-vectorized) and (for further background) [this blog post](https://julialang.org/blog/2017/01/moredots/).
