MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_asBits

Function UArray_asBits

libs/basekit/source/UArray_math.c:261–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261UArray *UArray_asBits(const UArray *self) {
262 UArray *out = UArray_new();
263 size_t i, max = UArray_sizeInBytes(self);
264 uint8_t *data = self->data;
265
266 for (i = 0; i < max; i++) {
267 uint8_t b = data[i];
268 int j;
269
270 for (j = 0; j < 8; j++) {
271 int v = (b >> j) & 0x1;
272 UArray_appendCString_(out, v ? "1" : "0");
273 }
274 }
275
276 return out;
277}
278
279size_t UArray_bitCount(UArray *self) {
280 const unsigned char map[] = {

Callers

nothing calls this directly

Calls 3

UArray_newFunction · 0.85
UArray_sizeInBytesFunction · 0.85
UArray_appendCString_Function · 0.85

Tested by

no test coverage detected