12 lines
328 B
Solidity
12 lines
328 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.36;
|
|
|
|
/// @title Rounding-up integer division that trusts its non-zero denominator.
|
|
library UnsafeMath {
|
|
function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
|
|
assembly {
|
|
z := add(div(x, y), gt(mod(x, y), 0))
|
|
}
|
|
}
|
|
}
|