# What is the traditional sign for square root?

**URL:** https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148
**Category:** Beginners
**Created:** [September 7, 2021, 11:36pm UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148 "2021-09-07T23:36:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [September 7, 2021, 11:36pm UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/1 "2021-09-07T23:36:05Z")

</div>

This is not necessarily a processing question, but I understand that in coding we can make use of operands such as / for divide, \* for multiply, ^ for power, is there a predefined operand for squareroot, or is it just traditionally accepted that squareroot is eg ^1/2

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [September 8, 2021, 2:54am UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/2 "2021-09-08T02:54:56Z")

</div>

Usually you can expect to have a `sqrt()` function. It might be in a math library. Or yes, you can just do `^(1/2.0)`.

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [September 8, 2021, 5:28am UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/3 "2021-09-08T05:28:24Z")

</div>

Quick follow up question I’m writing an evaluation parser, is there a recommendation for one over the other and if so why, or should both be suitable?

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [September 8, 2021, 7:03am UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/4 "2021-09-08T07:03:25Z")

</div>

> **[Square root](https://en.wikipedia.org/wiki/Square_root)**
>
> In mathematics, a square root of a number x is a number y such that y2 = x; in other words, a number y whose square (the result of multiplying the number by itself, or y ⋅ y) is x. For example, 4 and −4 are square roots of 16, because 42 = (−4)2 = 16.
> Every nonnegative real number x has a unique nonnegative square root, called the principal square root, which is denoted by 
>   
>     
>       
>         
>           
> x
>           
>         
> ,
>       
>     
> {\\displaystyle {\\sqrt {x}}

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [September 8, 2021, 7:13am UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/5 "2021-09-08T07:13:57Z")

</div>

OK but which is more practical when writing expressions

Let’s say `sqrt(9)*2*a+10 or 9^1/2*a+10`

Would you have a preference for one over the other or would you not mind so long as it was properly documented. To be fair I could implement both and just have a way to switch between both.

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [September 8, 2021, 8:09am UTC](https://discourse.processing.org/t/what-is-the-traditional-sign-for-square-root/32148/6 "2021-09-08T08:09:45Z")

</div>

You can also use the double star `**` operator like in [Python](https://stackoverflow.com/questions/1683008/what-does-the-maths-operator-do-in-python) or Ruby for exponentiation. (which is more common that `^` the bitwise XOR operator)

Concerning the `sqrt(9)` vs `9**(1/2)` (note the parenthesis here), it’s semantically the same, it depends on the user and how you clear you want it to be.

Also just for fun, see which is faster in Python:

> <https://stackoverflow.com/questions/327002/which-is-faster-in-python-x-5-or-math-sqrtx>
