Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

FixedPoint improvements #5

Merged
merged 11 commits into from
Oct 14, 2020
Merged

FixedPoint improvements #5

merged 11 commits into from
Oct 14, 2020

Conversation

NoahZinsmeister
Copy link
Contributor

@NoahZinsmeister NoahZinsmeister commented Jul 16, 2020

changelog

FixedPoint.sol

  • added explanatory comments about lossiness/reversion
  • replaced uint256 with uint
  • constrained Q112/Q224 to their smallest possible representation
  • remove unnecessary cast in mul
  • removed div
  • added muli
  • added overflow failure case for reciprocal
  • made sqrt less lossy

other

  • added boundary tests for Babylonian.sqrt
  • added boundary tests for mul
  • added tests for muli

uint256 -> uint
uint256 -> uint and less explicit casting
tweak require messages

optimize uint container sizes
add muli tests
@NoahZinsmeister NoahZinsmeister marked this pull request as ready for review October 14, 2020 15:46
contracts/libraries/FixedPoint.sol Outdated Show resolved Hide resolved
contracts/libraries/FixedPoint.sol Show resolved Hide resolved
contracts/libraries/FixedPoint.sol Outdated Show resolved Hide resolved
contracts/libraries/FixedPoint.sol Show resolved Hide resolved
test/Babylonian.spec.ts Outdated Show resolved Hide resolved
test/FixedPoint.spec.ts Show resolved Hide resolved
test/FixedPoint.spec.ts Show resolved Hide resolved
test/FixedPoint.spec.ts Outdated Show resolved Hide resolved
@NoahZinsmeister NoahZinsmeister merged commit 0be2391 into master Oct 14, 2020
@NoahZinsmeister NoahZinsmeister deleted the noah-changes branch October 14, 2020 16:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants