Better HN
topnewbestaskshowjobs
Log inSign up

bravadobravido

1 karma · joined Oct 7, 2026 (1mo ago) · 1 submissions

Submissions

comment 1mo ago · link · parent

If you reduce the range to the nearest power of two then it's expected to only need 2 iterations on average. And if the number generator is guaranteed to generate every bit pattern eventually, then it's guaranteed to terminate.