Commit Graph

2 Commits

Author SHA1 Message Date
fdfd9726e1 Move abs(int256) from Math to SafeMath (#3110)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit 3eb2d43b06)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-02-08 09:55:29 +01:00
3458c1e854 Add SignedMath with math utilities for signed integers (#2686)
* add contract and tests

* avoid implicit cast

* add test cases

* fix test names

* modify avarage and add tests

* improve signed average formula

* fix lint

* better average formula

* refactor signed average testing

* add doc and changelog entry

* Update contracts/utils/math/SignedMath.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* remove ceilDiv

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-12 20:08:59 +01:00