abdk-libraries-solidity icon indicating copy to clipboard operation
abdk-libraries-solidity copied to clipboard

I want to implement 4.pow(0.5)

Open GalaxySciTech opened this issue 4 years ago • 1 comments

Can you help me, I want to implement 4.pow(0.5) This calculation What should I do

GalaxySciTech avatar Sep 22 '21 07:09 GalaxySciTech

 // x^y
 // this can calculate 2^1.5 | 1.5 ^ 2  | 1.5^1.5 etc.
 function pow(bytes16 x,uint256 y) private pure returns(bytes16 result) {
    return ABDKMathQuad.pow_2(ABDKMathQuad.fromUInt(y).mul(x.log_2()));
}

jamesvan2019 avatar Apr 07 '22 06:04 jamesvan2019

You better ask such questions on https://ethereum.stackexchange.com

3sGgpQ8H avatar Oct 09 '22 10:10 3sGgpQ8H