A function which returns the absolute value of a signed value (#2984)
* Add a function which returns the absolute (and obviously unsigned) value of a signed value. * add changelog entry and fix lint Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -20,4 +20,8 @@ contract MathMock {
|
||||
function ceilDiv(uint256 a, uint256 b) public pure returns (uint256) {
|
||||
return Math.ceilDiv(a, b);
|
||||
}
|
||||
|
||||
function abs(int256 n) public pure returns (uint256) {
|
||||
return Math.abs(n);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user