The FairSideFormula library is using the ABDKMathQuad library underneath. According to the ABDKMathQuad README, the range of values is the following:
Using Echidna, a fuzzing tool for smart contracts, I found some edge cases in which some of the operations do not work as expected. This is the test code I ran using echidna-test contracts/TestABDKMathQuad --contract TestABDKMathQuad. see issue for more details.
If we check in Remix, we can see that there is a small difference when converting from UInt to Bytes16 (and vice versa). This issue is probably the same with all the other operations.
Recommend using some fuzzing tool like Echidna to verify that there are no edge cases.
fairside-core (FairSide) acknowledged:
