#ifndef BRESENHAM_DISTRIBUTION_H #define BRESENHAM_DISTRIBUTION_H #include /* C23 API. Return the bucket's item count, or UINTMAX_MAX on invalid input. * Require N < UINTMAX_MAX, B > 0, b < B, and shift < B. * B may equal UINTMAX_MAX; successful counts never do. * Positive shift rotates the heavy buckets towards increasing indices. */ uintmax_t bd_count(uintmax_t N, uintmax_t B, uintmax_t b, uintmax_t shift); uintmax_t bd_count_0(uintmax_t N, uintmax_t B, uintmax_t b); /* BD-C: center the minority (heavy when R <= B/2, light otherwise). * Has the same count/index contract as bd_count_0. */ uintmax_t bd_count_c(uintmax_t N, uintmax_t B, uintmax_t b); #endif