fix-dodomath-precision

This commit is contained in:
Skye
2024-01-14 23:59:15 +08:00
parent e44c328fb0
commit 10a496dd3b

View File

@@ -187,6 +187,9 @@ library DODOMath {
uint256 numerator; uint256 numerator;
if (bSig) { if (bSig) {
numerator = squareRoot.sub(bAbs); numerator = squareRoot.sub(bAbs);
if (numerator == 0) {
revert("DODOMath: should not be zero");
}
} else { } else {
numerator = bAbs.add(squareRoot); numerator = bAbs.add(squareRoot);
} }