Skip to content

Commit

Permalink
Merge pull request #3608 from ethereum/mkalinin-patch-6
Browse files Browse the repository at this point in the history
Introduce UINT64_MAX_SQRT
  • Loading branch information
hwwhww committed Feb 19, 2024
2 parents cdb6725 + 3e26508 commit 1a33bf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion specs/phase0/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ The following values are (non-configurable) constants used throughout the specif
| Name | Value |
| - | - |
| `UINT64_MAX` | `uint64(2**64 - 1)` |
| `UINT64_MAX_SQRT` | `uint64(4294967295)` |
| `GENESIS_SLOT` | `Slot(0)` |
| `GENESIS_EPOCH` | `Epoch(0)` |
| `FAR_FUTURE_EPOCH` | `Epoch(2**64 - 1)` |
Expand Down Expand Up @@ -601,7 +602,7 @@ def integer_squareroot(n: uint64) -> uint64:
Return the largest integer ``x`` such that ``x**2 <= n``.
"""
if n == UINT64_MAX:
return uint64(4294967295)
return UINT64_MAX_SQRT
x = n
y = (x + 1) // 2
while y < x:
Expand Down

0 comments on commit 1a33bf8

Please sign in to comment.