Open PaulRBerg opened 2 years ago
The catch is that PRBMath, unlike YieldMath, used 256 bits to represent the operands. I'm not sure if this is a show-stopper, in the sense that we can't implement a normalization factor like Yield does for 128 bits numbers.
I guess that in our case we should set f
to 2^256-1
but I'm not sure yet.
A "pow" function with a normalization factor would joggle with the numbers in such a way that it staves off overflows when the time to maturity is large.
See Yield's pow function, this PDF document:
And this algorithm explanation: