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

Commit

Permalink
Rename sqrt (#212)
Browse files Browse the repository at this point in the history
It's a naming conflict for Vyper.
  • Loading branch information
HardlyDifficult authored Nov 6, 2019
1 parent 3072b11 commit 229e43d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/math/Sqrt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library Sqrt
uint256 constant MAX_UINT = 2**256 - 1;

// Source: https://github.com/ethereum/dapp-bin/pull/50
function sqrt(
function sqrtUint(
uint x
) public pure
returns (uint y)
Expand Down
2 changes: 1 addition & 1 deletion test/math/sqrtNumbersArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ contract("math / sqrtNumbersArray", () => {
let sqrtResult = new BigNumber(x).sqrt();
it(`sqrt(${x.toFixed()}) ~= ${sqrtResult.toExponential(2)}`, async () => {
sqrtResult = sqrtResult.dp(0);
const contractRes = new BigNumber(await contract.sqrt(x.toFixed()));
const contractRes = new BigNumber(await contract.sqrtUint(x.toFixed()));
checkBounds(sqrtResult, contractRes);
});
}
Expand Down

0 comments on commit 229e43d

Please sign in to comment.