diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-09-04 11:55:37 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-09-04 11:55:37 +0800 |
commit | 99fbf384fdcae26eb608f9e0c95a852b7cb7bd99 (patch) | |
tree | 843ccc0183ffadc6d5c24881ea8fd707ed1937a5 /packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol | |
parent | cb4fcf4de7b9decad05536f2edf1c1ffd8666a72 (diff) | |
download | dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar.gz dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar.bz2 dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar.lz dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar.xz dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.tar.zst dexon-sol-tools-99fbf384fdcae26eb608f9e0c95a852b7cb7bd99.zip |
Apply styling fixes
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol index 57fd53f29..d8fed176c 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol @@ -24,7 +24,6 @@ import "../../../utils/SafeMath/SafeMath.sol"; contract LibMath is SafeMath { - /// @dev Calculates partial value given a numerator and denominator rounded down. /// Reverts if rounding error is >= 0.1% /// @param numerator Numerator. @@ -206,7 +205,11 @@ contract LibMath is // 1000 * remainder < numerator * target // so we have a rounding error iff: // 1000 * remainder >= numerator * target - uint256 remainder = mulmod(target, numerator, denominator); + uint256 remainder = mulmod( + target, + numerator, + denominator + ); isError = safeMul(1000, remainder) >= safeMul(numerator, target); return isError; } @@ -238,7 +241,11 @@ contract LibMath is return false; } // Compute remainder as before - uint256 remainder = mulmod(target, numerator, denominator); + uint256 remainder = mulmod( + target, + numerator, + denominator + ); // TODO: safeMod remainder = safeSub(denominator, remainder) % denominator; isError = safeMul(1000, remainder) >= safeMul(numerator, target); |