> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.getfoundry.sh/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

## `bound`

### Signature

```solidity
function bound(uint256 x, uint256 min, uint256 max) public returns (uint256 result);
```

### Description

A mathematical function for wrapping inputs of fuzz tests into a certain range.

You can use it instead of the `assume` cheatcode to get better performance in some cases. Read more [here](/reference/cheatcodes/assume.mdx).

### Examples

```solidity
input = bound(input, 99, 101);
```

Returns `99` for input `0`.

<br />

Returns `100` for input `1`.

<br />

Returns `101` for input `2`.

<br />

Returns `99` for input `3`.

<br />

And so on.
