Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
158 views

I'm refreshing my C skills (been decades) and ran across something I don't quite understand. I'm working on some code that involves a lot of bit shifting, masking, etc. I have one function that ...
Maryann's user avatar
  • 79
Advice
0 votes
1 replies
42 views

Given: all numbers are valid BigInts for expanding to 128 bits and beyond buttonArray holds 64 button objects a button is initalized through a .forEach loop and pushed onto buttonArray this makes ...
mwfarrell's user avatar
-4 votes
2 answers
125 views

In the hex byte A1 B2 C3 D4, ABCD would be the most significant bits of each pair, and 1234 would be the least significant. I find that these groups of bits are often operated on together in hardware-...
Hashim Aziz's user avatar
  • 6,578
0 votes
1 answer
99 views

We have DB2 LUW v11.5 and it supports both BINARY and CHAR FOR BIT DATA column data types. I've read the documentation, and I've Googled it, but I don't really see an effective difference between ...
Dave Clark's user avatar
0 votes
0 answers
85 views

I have two bitwise expressions and need to figure out which one is faster. Also, if there are other ways to implement the same, but in a faster way than the given expression. I am using these ...
ahmed 's user avatar
  • 11
-3 votes
1 answer
73 views

Input: unsigned char vet[] = { 0xBC,0xFF,0x01 };unsigned short int len = 18; Output: short int minLung;short int maxLung; Given a sequence of bits, determine the minimum and maximum length of ...
Tania Volo's user avatar
0 votes
1 answer
70 views

Looking into solving a very large data set problem by using bit manipulation to reduce compute Imagine billions of records that look like this(but more than 20k in length): Questions : A,B,C,D ...
HFX's user avatar
  • 31
1 vote
1 answer
83 views

I am looking for an algorithm to group bits from byte A based on mask (or tap) from B, on byte C, starting from least-significant. By way of example, the mask/tap (B) has bits 1,3,4 set to 1, which ...
affluentbarnburner's user avatar
1 vote
3 answers
147 views

I have an issue whereby a query called via Invoke-SQLCmd returns a certain set of results. For some columns the value is a 0 or 1 of BIT data type. The results instead come back as False or True in ...
Rami Aboulissane's user avatar
0 votes
1 answer
99 views

How can I determine the exact amount of memory in megabytes that a "char" data type uses, beyond just knowing its size in bytes, nibbles, kilobytes, and bits? I’ve tried using sizeof and ...
Santiago S's user avatar
1 vote
0 answers
73 views

I came across the following C++ solution for finding the smallest number greater than n that has the same number of 1's in its binary representation int solution(int n) { int pivot = n & -n; ...
git546's user avatar
  • 11
-2 votes
1 answer
262 views

in typescript, as the number type can be int or float, so what if I use number type with bit operations I have see some library use this const a = 1.23 const b = a | 0 Sorry for the inaccurate ...
Cody Z's user avatar
  • 23
0 votes
1 answer
77 views

I've been following along to Cave of Programming's C++ for Complete Beginners on Udemy, and in lesson 67 he goes over bitshifting to output certain colour pixels in an SDL window. There's a certain ...
Aaron Kelly's user avatar
0 votes
1 answer
145 views

A single 1 byte could be from 0 to 255. I intend to rescale it to be from 0 to 7. I have done this: bit8 := uint8(136) // To re-scale 1 byte from 0 to 2^3-1 i.e. 0 to 7 bit3 := bit8 / 0xff * 0b0111 ...
Megidd's user avatar
  • 8,233
-1 votes
1 answer
135 views

If I want to do the fastest way to calculate x * 2, which one should I use? x << 1 or x * 2 With the same logical thinking, if I want to do the fastest way to calculate x / 2, which one should ...
holydragon's user avatar
  • 6,778

15 30 50 per page
1
2 3 4 5
242