# What's the symbol for "the power of 2"

**URL:** <https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070>\
**Category:** Beginners\
**Created:** [June 15, 2019, 12:58am UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070 "2019-06-15T00:58:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![osibada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/osibada/32/5574_2.png) [@osibada](https://discourse.processing.org/u/osibada)\
**Post date:** [June 15, 2019, 12:58am UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070/1 "2019-06-15T00:58:57Z")

</div>

How to print the symbol (^2) in text for Processing 3?

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 15, 2019, 1:01am UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070/2 "2019-06-15T01:01:56Z")

</div>

You can just paste it directly into your code.

```auto
background(0);
textSize(40);
textAlign(CENTER,CENTER);
text("2²", width/2, height/2);

```

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 15, 2019, 3:55am UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070/3 "2019-06-15T03:55:07Z")

</div>

Hit AltGr + 2 in order to get a `²`. 😉

---

<div class="post-metadata">

**Author:** ![osibada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/osibada/32/5574_2.png) [@osibada](https://discourse.processing.org/u/osibada)\
**Post date:** [June 15, 2019, 2:08pm UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070/4 "2019-06-15T14:08:27Z")

</div>

Thanks for the quick reply!  
None of these work though ☹

This project I’m working on is for a blood pressure and pulse pressure continuously monitoring device. I am using a pulse sensor: ([https://cdn.shopify.com/s/files/1/0100/6632/files/Pulse\_Sensor\_Data\_Sheet.pdf?14358792549038671331](https://cdn.shopify.com/s/files/1/0100/6632/files/Pulse_Sensor_Data_Sheet.pdf?14358792549038671331))

And with the visualizer I have created seen in the photo below I am also projecting the live “PP” in mmHg. But the numbers I am getting should be reduced to their square root, but I have been trying for days and as a beginner in Java and programming in general, it’s been impossible. So I decided to just project it as it is (unless you have the answer) and use the “to the power of 2” symbol, but typing “2²” or “\u00B2” just types all of it out on the visualizer. And using the AltGr + 2 doesn’t show anything.

Let me know if anyone can help.

Here’s what I currently see if I type “2²”

 ![Text_Error](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/addd83788ca6c2d7579b2a06e60befe88a23b50e.jpeg)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 15, 2019, 2:35pm UTC](https://discourse.processing.org/t/whats-the-symbol-for-the-power-of-2/12070/5 "2019-06-15T14:35:30Z")

</div>

> [@osibada](#):
>
> the numbers I am getting should be reduced to their square root

For that, just use sqrt(). The reference page has a whole section on math and calculations.

> **[sqrt() / Reference](https://processing.org/reference/sqrt_.html)**
>
> Calculates the square root of a number. The square root of a number is always positive, even though there may be a valid negative root. The square root s of number a is such that s\*s …
