How can I calculate X * Y / Z in vyper uint256 without overflow and any loss of precision?

I want to build Vyper FullMath library functions similar to the Uniswap V3 FullMath library written in Solidity.

X * Y is definitely bigger than 2 ** 256 but the result will be in uint256 range.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.