You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This equality function that checks if two fractions are equal is incorrect since it doesn't normalize the fractions before checking the equality.
Therefore, this function will return false if it is called on fraction(1,2) and fraction(2,4) while they are equal.
Also, after normalizing the fractions, the function should start by checking if the denominators are equal, that way, if they aren't, it won't be necessary to check if the numerators are equal, since the fraction will definitely not be equal.
There is also a warning from the TON-Solidity-Compiler that says that library functions should have default mutability.
The text was updated successfully, but these errors were encountered:
In the
FPO
library inFloatingPointOperations.sol
:everscalend-contracts/smart-contracts/src/utils/libraries/FloatingPointOperations.sol
Lines 53 to 55 in 8d24e26
This equality function that checks if two fractions are equal is incorrect since it doesn't normalize the fractions before checking the equality.
Therefore, this function will return
false
if it is called onfraction(1,2)
andfraction(2,4)
while they are equal.Also, after normalizing the fractions, the function should start by checking if the denominators are equal, that way, if they aren't, it won't be necessary to check if the numerators are equal, since the fraction will definitely not be equal.
There is also a warning from the TON-Solidity-Compiler that says that library functions should have default mutability.
The text was updated successfully, but these errors were encountered: