I want to implement 4.pow(0.5) #254
-
Hey, I'm looking for the updated version of this question, since the library has changed since then. Also I'm wondering if it's going to be the same for 4.pow(1.5) |
Beta Was this translation helpful? Give feedback.
Answered by
PaulRBerg
May 12, 2025
Replies: 1 comment 1 reply
-
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);
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
VasilGrozdanov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @VasilGrozdanov! You can do that calculation like this now (using PRBMath v4.1.0):