summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/stdc_count_zeros.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
commitac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (patch)
tree9367490586c84cba28652e443e3166d66c33b0d9 /static/freebsd/man3/stdc_count_zeros.3
parent253e67c8b3a72b3a4757fdbc5845297628db0a4a (diff)
docs: Added All FreeBSD Manuals
Diffstat (limited to 'static/freebsd/man3/stdc_count_zeros.3')
-rw-r--r--static/freebsd/man3/stdc_count_zeros.384
1 files changed, 84 insertions, 0 deletions
diff --git a/static/freebsd/man3/stdc_count_zeros.3 b/static/freebsd/man3/stdc_count_zeros.3
new file mode 100644
index 00000000..762ba62d
--- /dev/null
+++ b/static/freebsd/man3/stdc_count_zeros.3
@@ -0,0 +1,84 @@
+.\"
+.\" Copyright (c) 2025 Robert Clausecker <fuz@FreeBSD.org>
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.Dd November 9, 2025
+.Dt STDC_COUNT_ZEROS 3
+.Os
+.Sh NAME
+.Nm stdc_count_zeros
+.Nd count the zeros in an integer
+.Sh SYNOPSIS
+.Lb libc
+.In stdbit.h
+.Ft unsigned int
+.Fn stdc_count_zeros_uc "unsigned char value"
+.Ft unsigned int
+.Fn stdc_count_zeros_us "unsigned short value"
+.Ft unsigned int
+.Fn stdc_count_zeros_ui "unsigned int value"
+.Ft unsigned int
+.Fn stdc_count_zeros_ul "unsigned long value"
+.Ft unsigned int
+.Fn stdc_count_zeros_ull "unsigned long long value"
+.Ft unsigned int
+.Fn stdc_count_zeros "value"
+.Sh DESCRIPTION
+The
+.Nm stdc_count_zeros_ Ns Em type Ns ()
+family of functions returns the number of bits set to\~0 in
+.Fa value ,
+where
+.Fa value
+is of type
+.Va unsigned char ,
+.Va unsigned short ,
+.Va unsigned int ,
+.Va unsigned long ,
+or
+.Va unsigned long long
+for
+.Em type
+being
+.Sy uc ,
+.Sy us ,
+.Sy ui ,
+.Sy ul ,
+or
+.Sy ull
+respectively.
+This is also known as the
+.Dq population count
+(popcount) or
+.Dq Hamming weight
+of the complement of
+.Fa value .
+The
+.Fn stdc_count_zeros "value"
+type-generic macro picks the appropriate
+.Nm stdc_count_zeros_ Ns Em type Ns ()
+function based on the type of
+.Fa value .
+.Sh RETURN VALUES
+Returns the number of bits set to\~0 in
+.Fa value .
+.Sh SEE ALSO
+.Xr stdbit 3 ,
+.Xr stdc_count_ones 3
+.Sh STANDARDS
+The
+.Nm stdc_count_zeros_ Ns Em type Ns ()
+family of functions and the
+.Fn stdc_count_zeros
+type-generic macro conform to
+.St -isoC-2023 .
+.Sh HISTORY
+The
+.Nm stdc_count_zeros_ Ns Em type Ns ()
+family of functions and the
+.Fn stdc_count_zeros
+type-generic macro were added in
+.Fx 15.1.
+.Sh AUTHOR
+.An Robert Clausecker Aq Mt fuz@FreeBSD.org