# \`2sqrt(2)\` is allowed, but \`2√2\` is not. Is this a bug?

**URL:** <https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544>\
**Category:** General Usage\
**Tags:** question, bug, design\
**Created:** [October 19, 2017, 1:55am UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544 "2017-10-19T01:55:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sleort](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sleort/32/4875_2.png) [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Post date:** [October 19, 2017, 1:55am UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544/1 "2017-10-19T01:55:17Z")

</div>

The [manual](https://docs.julialang.org/en/latest/manual/mathematical-operations/#Powers,-logs-and-roots-1) says

> | Function | Description |  
> |:------------------------ |:-------------------------------------------------------------------------- |  
> | `sqrt(x)`, `√x` | square root of `x` |

However,

```julia
julia> 2sqrt(2)
2.8284271247461903

julia> 2√2
ERROR: syntax: extra token "√" after end of expression

```

Is this a bug, or intended? (To me, `2√2` looks much better/cleaner than `2sqrt(2)` or `2*√2`…)

---

<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:** [October 19, 2017, 2:48am UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544/2 "2017-10-19T02:48:43Z")

</div>

Currently, multiplication by juxtaposition is not allowed for prefix operators. I don’t think we’d want to allow `2!true`, for example. So no, this is not a bug.

However, it seems pretty reasonable to allow this for the root operators as a future feature.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 19, 2017, 9:55pm UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544/3 "2017-10-19T21:55:41Z")

</div>

@Sleort it would be great if you could open an issue on GitHub for this feature request.

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [October 19, 2017, 11:01pm UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544/4 "2017-10-19T23:01:35Z")

</div>

It seems too complex to allow it for some prefix operators and not for others. Is there an elegant way to handle this?

---

<div class="post-metadata">

**Author:** ![Sleort](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sleort/32/4875_2.png) [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Post date:** [October 20, 2017, 12:38am UTC](https://discourse.julialang.org/t/2sqrt-2-is-allowed-but-2-2-is-not-is-this-a-bug/6544/5 "2017-10-20T00:38:33Z")

</div>

@juliohm [done](https://github.com/JuliaLang/julia/issues/24226) 🙂
