@@ -10,18 +10,30 @@ title: Bitsets
1010
1111The ` stdlib_bitsets ` module implements bitset types. A bitset is a
1212compact representation of a sequence of ` bits ` binary values. It can
13- equivalently be considered as a sequence of logical values or as a subset of
14- the integers 0 ... ` bits-1 ` . The bits are indexed from 0 to
13+ equivalently be considered as a sequence of logical values or as a
14+ subset of the integers 0 ... ` bits-1 ` . The bits are indexed from 0 to
1515` bits(bitset)-1 ` . A bitset is used when space savings are critical in
1616applications that require a large number
1717of closely related logical values.
18- It may also improve performance by reducing memory traffic. To implement
19- bitsets the module
18+ It may also improve performance by reducing memory traffic. To
19+ implement bitsets the module
2020defines three bitset types, multiple constants, a character string
2121literal that can be read to and from strings and formatted files, a
2222simple character string literal that can be read to and from strings,
2323assignments, procedures, methods, and operators. Note that the module
24- assumes two's complement integers, but all current Fortran 95+ processors use such integers.
24+ assumes two's complement integers, but all current Fortran 95+
25+ processors use such integers.
26+
27+ Note that the module defines a number of "binary" procedure,
28+ procedures with two bitset arguments. These arguments must be of the
29+ same type and should have the same number of ` bits ` . For reasons of
30+ performance the module does not enforce the ` bits ` constraint, but
31+ failure to obey that constraint results in undefined behavior. This
32+ undefined behavior includes undefined values for those bits that
33+ exceed the defined number of ` bits ` in the smaller bitset. The
34+ undefined behavior may also include a "segmentation fault" for
35+ attempting to address bits in the smaller bitset, beyond the defined
36+ number of ` bits ` . Other problems are also possible.
2537
2638
2739## The module's constants
0 commit comments