prb-math icon indicating copy to clipboard operation
prb-math copied to clipboard

Fix comment in "PRBMath.sqrt"

Open PaulRBerg opened this issue 3 years ago • 0 comments
trafficstars

As @nonergodic has aptly mentioned here, the comment on line 604 of PRBMath.sol is incorrect:

https://github.com/paulrberg/prb-math/blob/e33a042e4d1673fe9b333830b75c4765ccf3f5f2/contracts/PRBMath.sol#L604

Instead the comment should say something along the line of:

Set the initial guess to the largest power of two that is smaller than or equal to sqrt(x)

Relevant link: see OpenZeppelin's implementation.

PaulRBerg avatar Jul 12 '22 08:07 PaulRBerg