> 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/es/referencia-de-sintaxis/general/conditionals-and-comparisons.md).

# Condicionales

En Soulver, un condicional se expresa en una sola línea:

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

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

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

**Declarar una variable usando un condicional**

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

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

**Usando "and" y "or" en condicionales**

```
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" %}
&& and || también son compatibles
{% endhint %}

#### Operadores de comparación y booleanos

Soulver admite los operadores de comparación estándar de estilo ["C" style](https://en.wikipedia.org/wiki/C_\(programming_language\)).

Se devuelve un valor booleano (`true` o `false`).

| Nombre            | Operador |
| ----------------- | -------- |
| Igual a           | ==       |
| No igual a        | !=       |
| Mayor que         | >        |
| Menor que         | <        |
| Mayor o igual que | >=       |
| Menor o igual que | <=       |

Puede asignar un valor booleano a una variable directamente

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

También puede usar operadores de comparación fuera de las sentencias 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/es/referencia-de-sintaxis/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.
