Skip to content

Instantly share code, notes, and snippets.

View pratikpc's full-sized avatar

Pratik Chowdhury pratikpc

View GitHub Profile
#include <math.h>
#include <stdio.h>
// We know
// 2^k >= n + k + 1
unsigned GetKFromN (unsigned n)
{
for (unsigned k = 0;; ++k)
{
unsigned rhs = n + k + 1;