# Basic solidity and ursus operators, respectively

Here is a mapping of operators from solidity and the phased construction of operators in ursus

## Built-in operation for basic types

#### Arifmetic operations:

`x + y`

standart sum with number overflow:`x`

and`y`

has uint or int type- if one of the term has type uint and another has int, result will be int
- if one of the term has type uintN and another has uintM (N >= M), result will be uintN

- functions
`x - y`

,`x * y`

have the as same logic as the previous ones

# TODO comparing addresses

- functions
`x == y`

,`x != y`

work with boleans and nums, functions`x < y`

,`x <= y`

,`x > y`

,`x >= y`

works with nums. All of these functions have standart semanthic. `x / y`

standart division operation, but if at least one of the term is zero the result will be zero too`x % y`

standart modulo operation, but if`x`

is zero then result will be zero too

#### Bitwise operations:

`x ^ y`

is bitwise xor`x >> y`

is bitwise right`x << y`

is bitwise left`x & y`

is bitwise and`x \ y`

is bitwise or`~ x`

is bitwise not`bitSize(x)`

(Everscale only) computes the smallest c ≥ 0 such that x fits into a c-bit signed integer (−2^{c−1}≤ x < 2^{c−1}).`uBitSize(x)`

(Everscale only) uBitSize computes the smallest c ≥ 0 such that x fits into a c-bit unsigned integer (0 ≤ x < 2^{c}).

#### booleanean operations `x || y`

, `x && y`

and `!x`

have standart semantic

#### Math operations:

`math->muldiv(x, y, z)`

is syntax sugar for`(x * y) / z`

expression`math->muldivmod(x, y, z)`

is syntax sugar for`[ (x * y) / z, (x * y) % z ]`

`min(x, y)`

or`math->min(x, y)`

is standart math minimum function with standart semantic`max(x, y)`

or`math->max(x, y)`

is standart math max function with standart semantic`math->abs(x)`

is absolute function, which returns result with the same type as`x`