Problems related website
Salih Dincer
salihdb at hotmail.com
Tue Jul 26 07:26:36 UTC 2022
Hi,
Is it necessary to open a PR for problems with the website? For
example, part 2 of the first example is out of scope:
https://dlang.org/library/std/bitmanip/bit_array.this.html
I made the out of scope example more readable but who will update
it?
```d
void main()
{
import std.bitmanip;
import std.stdio;
import std.algorithm.comparison : equal;
import std.array : array;
import std.range : iota, repeat;
BitArray a = true.repeat(70).array;
writeln(a.length); // 70
assert(a.bitsSet.equal(iota(0, 70)));
size_t[] source = [1, 2, 3, 3424234, 724398, 230947, 389492];
enum sbits = size_t.sizeof * 8;
auto ba = BitArray(source, source.length * sbits);
foreach (n; 0 .. source.length * sbits)
{
const mask = 1L << (n % sbits);
const index = n / sbits;
auto nth_bit = source[index] & mask;
assert(ba[n] == cast(bool)nth_bit);
}
}
```
SDB at 79
More information about the Digitalmars-d
mailing list