[#BloombergLP-bdlb-BitStringUtil-bits]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/BitStringUtil.adoc[BitStringUtil]::bits
:relfileprefix: ../../../
:mrdocs:

Return a range of bits from `bitString` as an integer&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;bitstringutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
uint64&lowbar;t
bits(
    uint64&lowbar;t const* bitString,
    std::size&lowbar;t index,
    std::size&lowbar;t numBits);
----

== Description

Return the specified `numBits` beginning at the specified `index` in the specified `bitString` as the low&hyphen;order bits of the returned value&period; The behavior is undefined unless `numBits &lt;&equals; k&lowbar;BITS&lowbar;PER&lowbar;UINT64` and `bitString` has a length of at least `index &plus; numBits`&period;

== Return Value

the selected bits as the low&hyphen;order bits of the result

== Parameters

[cols="1,4"]
|===
| Name| Description
| *bitString*
| bit string to read
| *index*
| starting bit position
| *numBits*
| number of bits to return
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
