Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
3 answers
266 views

I have a bigint column or variable. I want to convert it into its bitmap (base 2) representation as a varchar and additionally to that count the 1s. I need both components - not just the bit_count ...
1 vote
1 answer
81 views

I am trying to move away from OpenCL and CUDA into ArrayFire. One of my functions uses the GPU's popcount() to make pre-processing data easier. But I can't find it anywhere in the list of functions in ...
8 votes
0 answers
280 views

While watching this talk by Matt Godbolt, I was astonished to see that Clang, if instructed to compile for the Haswell1 architecture, works out that the following code int foo(int a) { int count = ...
Enlico's user avatar
  • 30.3k
6 votes
3 answers
5k views

I have found out about __builtin_ctzll to count trailing zeros of a 64bit int really fast through the post Intrinsic to count trailing zero bits in 64-bit integers?. I'm a beginner to C++ and don't ...
0 votes
0 answers
381 views

I'm kind of new to CAPL. Today I am trying to use the output function for sending UDS messages on CAN, using a simple code below: UdsReq.dir = 1; UdsReq.byte(0) = 0x02; UdsReq.byte(1)...
0 votes
1 answer
565 views

I was using the __builtin_popcount with clang compiler and I needed to count a 64 bit number (unsigned long long or uint64_t). From looking it up, __builtin_popcount counts 16 bits, ...
BanjoMan's user avatar
-1 votes
2 answers
613 views

How do I modify this LC-3 code to make it count the number of 0s instead of ones .ORIG x3000 LD R2, INPUT AND R0, R0, #0 ; COUNTER INITIALIZED TO ZERO ADD R1, R0, #1 ADD ...
1 vote
2 answers
262 views

I am trying to do a XOR operation on two 64 bits Long variables in Java. The problem is that it fails when I add more than 16 bits in a variable. For instance this works and returns 7: Long h1 = ...
2 votes
4 answers
1k views

I have a square boolean matrix M of size N, stored by rows and I want to count the number of bits set to 1 for each column. For instance for n=4: 1101 0101 0001 1001 M stored as { { 1,1,0,1}, {0,1,...
9 votes
2 answers
9k views

I have a long chunk of memory, say, 256 KiB or longer. I want to count the number of 1 bits in this entire chunk, or in other words: Add up the "population count" values for all bytes. I ...
2 votes
1 answer
633 views

I have BIGINT column in my Redshift table, and I want a query that will: Count how many times the value '1' appears in each bit position across the binary value in all the rows of this column Will ...
6 votes
3 answers
3k views

What is the Big O of bit count? I'm not sure how the method works, but I would assume it is done in O(logn). Specifically with this code (where x = 4, y = 1): return Integer.bitCount(x^y);
data_pi's user avatar
  • 821
5 votes
3 answers
2k views

I know this is the code. But I'm not able to understand what it does `public static int bitCount(long i){ i = i - ((i > > > 1) & 0x5555555555555555L); i = (i & ...
0 votes
0 answers
252 views

I wanted to compare multiple images and retrieve the most similar image using hamming distance. The only problem is SQLite which is the most commonly available database in mobile platform doesn't ...
1 vote
2 answers
5k views

I am trying to write a program for the LC3 simulator that will allow me to count the amount of 1's in a binary number stored somewhere else in memory. Here is what I have so far: 0011 0001 0000 0000 ...
user avatar

15 30 50 per page
1
2 3 4

AltStyle によって変換されたページ (->オリジナル) /