# Numbers & Text > Math

## Arithmetic

### Add / Subtract / Multiply / Divide

Adds/Subtracts/Multiplies/Divides the two provided numbers. Note that only Chuck Norris can divide by 0.

```
([NUMBER] + [NUMBER])
([NUMBER] - [NUMBER])
([NUMBER] * [NUMBER])
([NUMBER] / [NUMBER])
```

### Negate

Flips the sign of the given number.

`-([NUMBER])`

### Remainder (Modulo)

Returns the integer remainder after dividing the first number by the second.

`([NUMBER] % [NUMBER])`

## Random Numbers

### Random Integer

Returns a random integer between the first and second numbers, inclusive. Provide integers for both numbers.

`randomInt(Math.floor(Number), Math.floor(Number))`

### Random Floating Point Number

Returns a random floating point number between 0 and 1, inclusive.

`randomFloat()`

## Increment / Decrement

### Increment / Decrement Number

Adds (or subtracts) the given number to/from a **number attribute**.

```
[ATTRIBUTE] += [NUMBER];
[ATTRIBUTE] -= [NUMBER];
```

## Operations

### Absolute Value

Returns the absolute value of the given number. (If it is negative, makes it positive.)

`Math.abs([NUMBER])`

### Smaller / Larger of Two Numbers

Returns the smaller (or larger) of the two numbers.

```
Math.min([NUMBER], [NUMBER])
Math.max([NUMBER], [NUMBER])
```

### Round / Floor / Ceiling

Returns the nunber as an integer, with rounding applied as follows:

**Round** - Rounds up if the fractional part is 0.5 or more. Otherwise, rounds down.

**Floor** - Always rounds down.

**Ceiling** - Always rounds up.

```
Math.round([NUMBER])
Math.floor([NUMBER])
Math.ceil([NUMBER])
```

## Conversion

### Number Conversion

Converts the given value (can be any type) to a number. In practice, this is mainly useful for text and booleans (where true = 1, false = 0).

`asNumber([VALUE])`