> For the complete documentation index, see [llms.txt](https://documentation.soulver.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.soulver.app/ko/undefined/general/conditionals-and-comparisons.md).

# 조건문

Soulver에서 조건문은 한 줄에 표현됩니다:

```
earnings = $45k                                 | $45,000.00

if earnings > $30k then tax = 20% else tax = 5% | 20%

My tax paid: earnings × tax                     | $9,000.00
```

**조건문을 사용하여 변수 선언하기**

```
income = $35k
expenses = $21.5k

profitable = true if income > expenses     | true
insolvent = false unless expenses > income | false
```

**조건문에서 "and"와 "or" 사용하기**

```
BMI = 24
Underweight = BMI < 18.5                  | false
Healthy Weight = BMI >= 18.5 and BMI < 25 | true
Overweight = BMI >= 25 and BMI < 30       | false
Obese = BMI >= 30                         | false
```

{% hint style="info" %}
&&와 ||도 지원됩니다
{% endhint %}

#### 비교 연산자 및 불리언

Soulver는 표준 ["C" 스타일](https://en.wikipedia.org/wiki/C_\(programming_language\)) 비교 연산자를 지원합니다.

불리언 값(`true` 또는 `false`)이 반환됩니다.

| Name                     | Operator |
| ------------------------ | -------- |
| Equal to                 | ==       |
| Not equal to             | !=       |
| Greater than             | >        |
| Less than                | <        |
| Greater than or equal to | >=       |
| Less than or equal to    | <=       |

변수에 불리언 값을 직접 할당할 수 있습니다.

```
cost = $500                                 
discount = true                        
if discount then cost = cost - 10%
cost | $450.00
```

또한 if문 외부에서도 비교 연산자를 사용할 수 있습니다.

```
20km == 20,000 m   | true
11:30 am < 9:30 am | false
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.soulver.app/ko/undefined/general/conditionals-and-comparisons.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
