# Integer

Operators and functions for working with integers of **int** type are described here.

* [Abs( int i ) int](/stdlib/integer.md#abs-int-i-int)
* [bool( int i ) bool](/stdlib/integer.md#bool-int-i-bool)
* [float( int i ) float](/stdlib/integer.md#float-int-i-float)
* [Max( int l, int r ) int](/stdlib/integer.md#max-int-l-int-r-int)
* [Min( int l, int r ) int](/stdlib/integer.md#min-int-l-int-r-int)
* [Random( int n ) int](/stdlib/integer.md#random-int-n-int)
* [str( int i ) str](/stdlib/integer.md#str-int-i-str)

## Operators

| Operator        | Result | Description                                                                                       |
| --------------- | ------ | ------------------------------------------------------------------------------------------------- |
| int **?**       | bool   | *true*, if the number doesn't equal zero.                                                         |
| int **+** int   | int    | The addition of two integers.                                                                     |
| int **-** int   | int    | Subtract two integers.                                                                            |
| int **\*** int  | int    | Multiplication of two integers.                                                                   |
| int **/** int   | int    | The division of two integers. When dividing by zero, an error is returned.                        |
| int **==** int  | bool   | Returns *true* if two numbers are equal and *false*, otherwise.                                   |
| int **>** int   | bool   | Returns *true* if the first number is greater than the second and *false*, otherwise.             |
| int **<** int   | bool   | Returns *true* if the first number is less than the second and *false*, otherwise.                |
| int **!=** int  | bool   | Returns *true* if two numbers are not equal and *false*, otherwise.                               |
| int **>=** int  | bool   | Returns *true* if the first number is greater than or equal to the second and *false*, otherwise. |
| int **<=** int  | bool   | Returns *true* if the first number is less than or equal to the second and *false*, otherwise.    |
| int **%** int   | int    | Returns the remainder after dividing two numbers (modulo operator).                               |
| int **\|** int  | int    | Bitwise OR.                                                                                       |
| int **^** int   | int    | Bitwise XOR.                                                                                      |
| int **&** int   | int    | Bitwise AND.                                                                                      |
| int **<<** int  | int    | Bitwise left shift.                                                                               |
| int **>>** int  | int    | Bitwise right shift.                                                                              |
| **-** int       | int    | Change the sign of an integer.                                                                    |
| **^** int       | int    | Bitwise NOT.                                                                                      |
| int **=** int   | int    | Simple assignment operator.                                                                       |
| int **=** char  | int    | Assigning a character to a variable.                                                              |
| int **+=** int  | int    | Add and assignment operator.                                                                      |
| int **-=** int  | int    | Subtract and assignment operator.                                                                 |
| int **/=** int  | int    | Divide and assignment operator.                                                                   |
| int **\*=** int | int    | Multiply and assignment operator.                                                                 |
| int **%=** int  | int    | Modulus and assignment operator.                                                                  |
| int **\|=** int | int    | Bitwise and assignment operator.                                                                  |
| int **^=** int  | int    | Bitwise exclusive OR and assignment operator.                                                     |
| int **&=** int  | int    | Bitwise inclusive OR and assignment operator.                                                     |
| int **<<=** int | int    | Left shift and assignment operator.                                                               |
| int **>>=** int | int    | Right shift AND assignment operator.                                                              |

## Functions

### Abs(int i) int

The *Abs* function returns the absolute value of the number.

### bool(int i) bool

The *bool* function returns *false* if the passed parameter is 0, otherwise it returns *true*.

### float(int i) float

The *float* function converts an integer to a *float* number.

### Max(int l, int r) int

The *Max* function returns the maximum of two values.

### Min(int l, int r) int

The *Min* function returns the minimum of two values.

### Random(int n) int

The *Random* function returns a non-negative pseudo-random number in \[0,n).

### str(int i) str

The *str* function converts an integer to a string.


---

# 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.gentee.org/stdlib/integer.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.
