# Base logic

## Boolean operators

### <mark style="color:red;">`()`</mark>

Breakets can be used to combine expressions

### <mark style="color:red;">`x if smth else y`</mark>

Conditional operator.

Returns <mark style="color:red;">`x`</mark> if <mark style="color:red;">`smth`</mark> is True

Returns <mark style="color:red;">`y`</mark> if <mark style="color:red;">smth</mark> is False

<mark style="color:red;">`x`</mark>, <mark style="color:red;">`y`</mark>, <mark style="color:red;">`smth`</mark> - can be <mark style="color:red;">`decimal`</mark>, <mark style="color:red;">`function call`</mark>, <mark style="color:red;">`custom formula`</mark>, <mark style="color:red;">`math expr`</mark> or <mark style="color:red;">`bool`</mark>

### <mark style="color:red;">`<x> or <y>`</mark>

Boolean operator <mark style="color:red;">`or`</mark>. Returns <mark style="color:red;">`bool`</mark>

Any non-zero value for operands casts as True (ex: 1 → True, 0 → False)

Truth table:

| x     | y     | result |
| ----- | ----- | ------ |
| True  | True  | True   |
| True  | False | True   |
| False | True  | True   |
| False | False | False  |

### <mark style="color:red;">`<x> and <y>`</mark>

Boolean operator <mark style="color:red;">`and`</mark>. Returns <mark style="color:red;">`bool`</mark>

Any non-zero value for operands casts as True (ex: 1 → True, 0 → False)

Truth table:

| x     | y     | result |
| ----- | ----- | ------ |
| True  | True  | True   |
| True  | False | False  |
| False | True  | False  |
| False | False | False  |

### <mark style="color:red;">`<x> == <y>`</mark>

Equivalent op. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 1 | True   |
| 0 | 1 | False  |
| 1 | 0 | False  |

### <mark style="color:red;">`` `<x> ``</mark>

Boolean operator <mark style="color:red;">`and`</mark>. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 1 | False  |
| 1 | 0 | True   |
| 0 | 1 | True   |

### <mark style="color:red;">`<x> > <y>`</mark>

\#v1 #v2

Boolean operator <mark style="color:red;">`greater`</mark>. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 0 | True   |
| 0 | 1 | False  |
| 1 | 1 | False  |

### <mark style="color:red;">`<x> >= <y>`</mark>

\#v1 #v2

Boolean operator <mark style="color:red;">`greater or equivalent`</mark>. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 0 | True   |
| 0 | 1 | False  |
| 1 | 1 | True   |

### <mark style="color:red;">`<x> < <y>`</mark>

\#v1 #v2

Boolean operator <mark style="color:red;">`less`</mark>. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 0 | False  |
| 0 | 1 | True   |
| 1 | 1 | False  |

### <mark style="color:red;">`<x> <= <y>`</mark>

\#v1 #v2

Boolean operator <mark style="color:red;">`less or equivalent`</mark>. Returns <mark style="color:red;">`bool`</mark>

Truth table:

| x | y | result |
| - | - | ------ |
| 1 | 0 | False  |
| 0 | 1 | True   |
| 1 | 1 | True   |

## Math operators

### <mark style="color:red;">`()`</mark>

Breakets can be used to combine expressions

### <mark style="color:red;">`<x> / <y>`</mark>

Division operator. Returns `decimal`

### <mark style="color:red;">`<x> * <y>`</mark>

Multiplication operator. Returns `decimal`

### <mark style="color:red;">`<x> + <y>`</mark>

Sum operator. Returns `decimal`

### <mark style="color:red;">`<x> - <y>`</mark>

Subtraction operator. Returns `decimal`

### <mark style="color:red;">`<x> ** <y>`</mark>

Exponentiation operator. Returns `decimal`

### <mark style="color:red;">`<x> ^ <y>`</mark>


---

# 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://docs.origami.tech/function/base-logic.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.
