{
    "Function": "slitherConstructorConstantVariables",
    "File": "src/contracts/lib/LibMath.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "library LibMath {\n    uint256 private constant POSITIVE_INT256_MAX = 2**255 - 1;\n\n    function toInt256(uint256 x) internal pure returns (int256) {\n        require(x <= POSITIVE_INT256_MAX, \"uint256 overflow\");\n        return int256(x);\n    }\n\n    function abs(int256 x) internal pure returns (int256) {\n        return x > 0 ? int256(x) : int256(-1 * x);\n    }\n\n    /**\n     * @notice Get sum of an (unsigned) array\n     * @param arr Array to get the sum of\n     * @return Sum of first n elements\n     */\n    function sum(uint256[] memory arr) internal pure returns (uint256) {\n        uint256 n = arr.length;\n        uint256 total = 0;\n\n        for (uint256 i = 0; i < n; i++) {\n            total += arr[i];\n        }\n\n        return total;\n    }\n\n    /**\n     * @notice Get sum of an (unsigned) array, for the first n elements\n     * @param arr Array to get the sum of\n     * @param n The number of (first) elements you want to sum up\n     * @return Sum of first n elements\n     */\n    function sumN(uint256[] memory arr, uint256 n) internal pure returns (uint256) {\n        uint256 total = 0;\n\n        for (uint256 i = 0; i < n; i++) {\n            total += arr[i];\n        }\n\n        return total;\n    }\n\n    /**\n     * @notice Get the mean of an (unsigned) array\n     * @param arr Array of uint256's\n     * @return The mean of the array's elements\n     */\n    function mean(uint256[] memory arr) internal pure returns (uint256) {\n        uint256 n = arr.length;\n\n        return sum(arr) / n;\n    }\n\n    /**\n     * @notice Get the mean of the first n elements of an (unsigned) array\n     * @dev Used for zero-initialised arrays where you only want to calculate\n     *      the mean of the first n (populated) elements; rest are 0\n     * @param arr Array to get the mean of\n     * @param len Divisor/number of elements to get the mean of\n     * @return Average of first n elements\n     */\n    function meanN(uint256[] memory arr, uint256 len) internal pure returns (uint256) {\n        return sumN(arr, len) / len;\n    }\n\n    /**\n     * @notice Get the minimum of two unsigned numbers\n     * @param a First number\n     * @param b Second number\n     * @return Minimum of the two\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @notice Get the minimum of two signed numbers\n     * @param a First (signed) number\n     * @param b Second (signed) number\n     * @return Minimum of the two number\n     */\n    function signedMin(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n}"
}