# try_mul

Multiplies two UINT256 values using a 512-bit intermediate. Arithmetic overflow produces NULL; independently, ordinary scalar NULL propagation produces NULL when either input is NULL.

Canonical HTML: <https://determica.com/docs/functions/try_mul>

- Kind: scalar function
- Category: [EVM utilities](/docs/category/evm-utilities.md)
- Tags: Types, EVM

Multiplies two UINT256 values using a 512-bit intermediate. Arithmetic overflow produces NULL; independently, ordinary scalar NULL propagation produces NULL when either input is NULL.

## Overload 1: try_mul(UINT256, UINT256)

```sql
try_mul(UINT256, UINT256)
```

Returns a * b when the 512-bit product fits UINT256, otherwise NULL.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `a` (UINT256; required; positional) — UINT256 factor.
- `b` (UINT256; required; positional) — UINT256 factor.

### Returns

Checked product

UINT256 product, or NULL for arithmetic overflow or an input NULL.

- `product` (UINT256)

Checked product. UINT256 product, or NULL for arithmetic overflow or an input NULL.

### Examples

_Local SQL · Local_

```sql
SELECT try_mul(6::UINT256, 7::UINT256)::VARCHAR AS result;
-- => [{"result":"42"}]
```

## Related functions

- [evm_addmod](/docs/functions/evm_addmod.md) — See Also
- [evm_mulmod](/docs/functions/evm_mulmod.md) — See Also
- [muldiv](/docs/functions/muldiv.md) — See Also
