Skip to content
Discussion options

You must be logged in to vote

Hey @VasilGrozdanov! You can do that calculation like this now (using PRBMath v4.1.0):

pragma solidity >=0.8.19;

import { UD60x18, ud } from "@prb/math/src/UD60x18.sol"; // v4.1.0

contract Demo {
    function demo() external pure returns (UD60x18 result) {
        UD60x18 base = ud(4e18);
        UD60x18 exp = ud(5e17);
        result = base.pow(exp);
    }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VasilGrozdanov
Comment options

Answer selected by VasilGrozdanov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants