MathUtils
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
A library to be used in conjunction with SafeMath. Contains functions for calculating differences between two uint256.
within1(uint256 a, uint256 b)
difference(uint256 a, uint256 b)
within1(uint256 a, uint256 b) → bool
Compares a and b and returns true if the difference between a and b is less than 1 or equal to each other.
a
: uint256 to compare with
b
: uint256 to compare with
True if the difference between a and b is less than 1 or equal,
otherwise return false
difference(uint256 a, uint256 b) → uint256
Calculates absolute difference between a and b
a
: uint256 to compare with
b
: uint256 to compare with
Difference between a and b