# Operators

GoMelan supports many basic operators.

{% hint style="info" %}
In our language, operators are subject to the rules of operator precedence, ensuring calculations are performed in the intended sequence.
{% endhint %}

## Basic Operators in GoMelan

GoMelan supports various basic operators that can be applied to numeric types, such as Int and Float. It's essential to ensure that the types are consistent throughout the calculation.

{% hint style="warning" %}
Becareful, to apply these operators, all the types should be the same across the whole calculation.\
\
For example if you want to do

`var:`<mark style="color:red;">`Float`</mark><mark style="color:purple;">`=`</mark><mark style="color:blue;">`0.1`</mark>`+`<mark style="color:blue;">`2`</mark>`;`

Please consider converting your types\
`var:`<mark style="color:red;">`Float`</mark><mark style="color:purple;">`=`</mark><mark style="color:blue;">`0.1`</mark>`+ intToFloat(2);`
{% endhint %}

### **Arithmetic Operators**

* **Addition (+):**

  ```php
  result: Float = 2.5 + 3.8;
  ```
* **Subtraction (-):**

  ```php
  difference: Int = 10 - 4;
  ```
* **Multiplication (\*):**

  ```php
  product: Float = 4.0 * 2.5;
  ```
* **Division (/):**

  ```php
  quotient: Int = 15 / 3;
  ```

### **Comparison Operators**

* **Equal (==):**

  ```php
  isEqual: Bool = 5 == 5;
  ```
* **Not Equal (!=):**

  ```php
  notEqual: Bool = 10 != 5;
  ```
* **Greater Than (>):**

  ```php
  isGreaterThan: Bool = 8 > 5;
  ```
* **Less Than (<):**

  ```php
  isLessThan: Bool = 3 < 7;
  ```
* **Greater Than or Equal To (>=):**

  ```php
  isGreaterOrEqual: Bool = 6 >= 6;
  ```
* **Less Than or Equal To (<=):**

  ```php
  isLessOrEqual: Bool = 9 <= 10;
  ```

### **Logical Operators**

* **Logical AND (&&):**

  ```php
  result: Bool = true && false;
  ```
* **Logical OR (||):**

  ```php
  result: Bool = true || false;
  ```
* **Logical NOT (!):**

  ```php
  notResult: Bool = !true;
  ```


---

# 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://glados.guillaume-hein.fr/features/operators.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.
