MathUtils

Git Source

A library to perform math operations with optimizations.

This library is based on the code snippet from the OpenZeppelin Contracts Math library. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/05d4bf57ffed8c65256ff4ede5c3cf7a0b738e7d/contracts/utils/math/Math.sol

Functions

diff

Calculates the absolute difference between two unsigned integers.

function diff(uint256 a, uint256 b) internal pure returns (uint256);

Parameters

NameTypeDescription
auint256The first number.
buint256The second number.

Returns

NameTypeDescription
<none>uint256The absolute difference between a and b.