# `./fio-stl/002 math.h`

6 public symbols.

### Functions

#### `fio_math_div`

```c
inline void fio_math_div(uint64_t *dest, uint64_t *reminder, const uint64_t *a, const uint64_t *b, const size_t number_array_length)
```

Multi-precision DIV for `len*64` bit long a, b.

This is NOT constant time.

The algorithm might be slow, as my math isn't that good and I couldn't
understand faster division algorithms (such as Newton–Raphson division)... so
this is sort of a factorized variation on long division.

_Symbol type:_ `function`

#### `fio_math_shr`

```c
inline void fio_math_shr(uint64_t *dest, uint64_t *n, const size_t right_shift_bits, size_t number_array_length)
```

Multi-precision shift right for `len` word number `n`.

_Symbol type:_ `function`

#### `fio_math_shl`

```c
inline void fio_math_shl(uint64_t *dest, uint64_t *n, const size_t left_shift_bits, const size_t number_array_length)
```

Multi-precision shift left for `len*64` bit number `n`.

_Symbol type:_ `function`

#### `fio_math_inv`

```c
inline void fio_math_inv(uint64_t *dest, uint64_t *n, size_t len)
```

Multi-precision Inverse for `len*64` bit number `n` (turn `1` into `-1`).

_Symbol type:_ `function`

#### `fio_math_msb_index`

```c
FIO_MIFN size_t fio_math_msb_index(uint64_t *n, const size_t len)
```

Multi-precision - returns the index for the most significant bit or -1.

_Symbol type:_ `function`

#### `fio_math_lsb_index`

```c
FIO_MIFN size_t fio_math_lsb_index(uint64_t *n, const size_t len)
```

Multi-precision - returns the index for the least significant bit or -1.

_Symbol type:_ `function`

-----------------------------------------------------
