# \[수학] 제곱 / 제곱근 / 거듭제곱

### 코드

{% code title="값의 제곱을 구할 때" %}

```
@수학 (값)의 제곱
```

{% endcode %}

{% code title="값의 제곱근을 구할 때" %}

```
@수학 (값)의 제곱근
```

{% endcode %}

{% code title="값의 거듭 제곱을 구할 때" %}

```
@수학 (밑)의 (지수)제곱/거듭제곱/승
```

{% endcode %}

***

### 설명

값에 대한 제곱 / 제곱근 / 거듭 제곱 결과를 반환합니다.

* 제곱: $$x^2$$
* 제곱근: $$\sqrt{x}$$ 또는 $$x^{0.5}$$
* 거듭제곱: $$a^b$$ ($$a$$는 밑, $$b$$는 지수)

***

### 주의사항

* 수학 코드를 쓸 때는 앞에 `@수학`을 써야 해요.
* 반올림 기준은 0.5예요.

***

### 파이썬 대응 코드

```
import math

x ** y
math.sqrt(x)
pow(x, y)
```

***

### 예시

{% code title="예시 코드" %}

```
# 제곱
@수학 5의 제곱 보여주기

# 제곱근
@수학 16의 제곱근 보여주기

# 거듭제곱/제곱/승
@수학 2의 10제곱 보여주기
@수학 2의 3거듭제곱 보여주기
@수학 3의 3승 보여주기
```

{% endcode %}

{% code title="예시 코드의 결과" %}

```
25    # 5의 제곱
4     # 16의 제곱근
1024  # 2의 10제곱
8     # 2의 3거듭제곱
27    # 3의 3승
```

{% endcode %}

***

### 검색 키워드

수학, 제곱, 루트, 제곱근, 거듭제곱, 지수제곱, 승


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codebook.horang.it/math/undefined-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
