Loading

evm_ceil_div

Scalar function

Ceiling division: (x + y - 1) / y. Rounds up to ensure no remainder. Common pattern for distributing amounts without leaving dust.

evm_ceil_div(UINT256, UINT256)

Parameters

Name Type
x UINT256
y UINT256

Returns

Name Type
result UINT256
1
SELECT evm_ceil_div(total_amount, num_recipients) AS amount_per;
Notebook ready in readonly mode.