mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 22:16:07 -05:00
[integer-sqrt] add comment to credit 'newton's method'
This commit is contained in:
@@ -302,6 +302,7 @@ Finally, we define `integer_sqrt` for use in reward/penalty calculations:
|
||||
|
||||
```python
|
||||
def integer_sqrt(n):
|
||||
# Utilizes "Newton's Method"
|
||||
x = n
|
||||
y = (x + 1) // 2
|
||||
while y < x:
|
||||
|
||||
Reference in New Issue
Block a user