STDC_COUNT_ZEROS(3)

πŸ“¦ version 15.1, in freebsd 15.1

✨ STDC_COUNT_ZEROS(3) ✨

okay so this is the STDC_COUNT_ZEROS(3) page, and it lives in the Library Functions Manual. it's giving niche-bit-math main character energy, and honestly? we're here for it. πŸ’…βœ¨


🌸 NAME 🌸

stdc_count_zeros β€” count the zeros in an integer. no cap, that's the whole name vibe. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

okay bestie, here's the exact synopsis β€” do not let the _uc / _us / _ui / _ul / _ull alphabet soup scare you. iykyk. 🫢

Standard C Library (libc, -lc) #include <stdbit.h>

unsigned int
stdc_count_zeros_uc(unsigned char value);

unsigned int
stdc_count_zeros_us(unsigned short value);

unsigned int
stdc_count_zeros_ui(unsigned int value);

unsigned int
stdc_count_zeros_ul(unsigned long value);

unsigned int
stdc_count_zeros_ull(unsigned long long value);

unsigned int
stdc_count_zeros(value);

πŸŽ€ DESCRIPTION πŸŽ€

The stdc_count_zeros_type() family of functions returns the number of bits set to 0 in value, 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. πŸ’–

This is also known as the β€œpopulation count” (popcount) or β€œHamming weight” of the complement of value. yes, we're counting the zero bits and calling it fancy. ✨

The stdc_count_zeros(value) type-generic macro picks the appropriate stdc_count_zeros_type() function based on the type of value. the way it just knows? obsessed. 🫢

🌈 RETURN VALUES 🌈

Returns the number of bits set to 0 in value. fr fr, that's the whole return value. highkey perfect. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

πŸ’œ STANDARDS πŸ’œ

The stdc_count_zeros_type() family of functions and the stdc_count_zeros() type-generic macro conform to . πŸŽ€

standards vibe check: yes, it literally ends with conform to . β€” that lonely period is canon, bestie. πŸ’€

πŸ¦‹ HISTORY πŸ¦‹

The stdc_count_zeros_type() family of functions and the stdc_count_zeros() type-generic macro were added in FreeBSD 15.1. slay. πŸ‘‘

🌟 AUTHOR 🌟

Robert Clausecker <fuz@FreeBSD.org> β€” thank you for this zero-counting gift, legend. 🫢


xoxo bestie, this was STDC_COUNT_ZEROS(3) β€” brought to you by Debian and dated November 9, 2025. now go count some zeros, periodt. πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ“œ the page's license: BSD-2-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms