{
    "Function": "power",
    "File": "contracts/Test/TestBancorFormula.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "generalExp",
        "generalLog",
        "optimalExp",
        "require(bool)",
        "optimalLog",
        "findPositionInMaxExpArray"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function power(uint256 _baseN, uint256 _baseD, uint32 _expN, uint32 _expD) internal view returns (uint256, uint8) {\n        require(_baseN < MAX_NUM);\n\n        uint256 baseLog;\n        uint256 base = _baseN * FIXED_1 / _baseD;\n        if (base < OPT_LOG_MAX_VAL) {\n            baseLog = optimalLog(base);\n        }\n        else {\n            baseLog = generalLog(base);\n        }\n\n        uint256 baseLogTimesExp = baseLog * _expN / _expD;\n        if (baseLogTimesExp < OPT_EXP_MAX_VAL) {\n            return (optimalExp(baseLogTimesExp), MAX_PRECISION);\n        }\n        else {\n            uint8 precision = findPositionInMaxExpArray(baseLogTimesExp);\n            return (generalExp(baseLogTimesExp >> (MAX_PRECISION - precision), precision), precision);\n        }\n    }"
}