stdc_bit_floor3
Round down to the previous power of 2
Usage
Standard C Library (libc, -lc)
#include <stdbit.h>
unsigned char
stdc_bit_floor_uc(unsigned char value);
unsigned short
stdc_bit_floor_us(unsigned short value);
unsigned int
stdc_bit_floor_ui(unsigned int value);
unsigned long
stdc_bit_floor_ul(unsigned long value);
unsigned long long
stdc_bit_floor_ull(unsigned long long value);
typeof Ns Pq Em value
stdc_bit_floor(value);
Overview
The stdc_bit_floor_type() family of functions rounds value down to the previous power of 2, where value is of type unsigned char, unsigned short, unsigned int, unsigned long, or unsigned long long for type being uc, us, ui, ul, or ull respectively. The stdc_bit_floor(value) type-generic macro picks the appropriate stdc_bit_floor_type() function based on the type of value.
Return values
Returns value round down to the previous power of 2. If value is equal to zero, zero is returned.
Releases
2 releases since FreeBSD 15.1-RELEASE; the text changed 1 time.