Content pfp
Content
@
0 reply
0 recast
0 reaction

Eric Forgy pfp
Eric Forgy
@ericforgy
For those who need more than trivial mathematics in your smart contracts, I'm sure you understand the frustration that led me to write this: https://www.linkedin.com/pulse/mathematical-modeling-floating-point-numbers-solidity-eric-forgy-sm0kc/ I've open-sourced a new floating-point math library for Solidity.
1 reply
0 recast
2 reactions

Eric Forgy pfp
Eric Forgy
@ericforgy
Zero docs so far and the code is horribly unoptimized, but it works. https://github.com/CavalRe/cavalre-contracts PRS / feedback is welcome.
1 reply
0 recast
0 reaction

Eric Forgy pfp
Eric Forgy
@ericforgy
Using this, I've been able to fuzz tests swaps smaller than 10^-1000 and larger than 10^1000. I just added an exponent function that can compute exp(1_000_000) and exp(-1_000_000) with 18 decimals accuracy. Real numerics in Solidity. You're welcome 🤠
0 reply
0 recast
0 reaction