Transpile e170b59f

This commit is contained in:
github-actions
2022-02-08 09:01:46 +00:00
parent 6f7d517d7c
commit 47de4b8f94
8 changed files with 45 additions and 39 deletions

View File

@ -30,4 +30,14 @@ library SignedMathUpgradeable {
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}