Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1036054 // countDifferingBits_1024bit

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (49L/1K).

1  
// use sub-array of array2, fixed length of array1 = 1024 bits
2  
static int countDifferingBits_1024bit(long[] array1, long[] array2, int i1) {
3  
  int diff = 0;
4  
  for (int i = 0; i < 1024/64; i++)
5  
    diff += popCount(array1[i]^array2[i1+i]);
6  
  ret diff;
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036054
Snippet name: countDifferingBits_1024bit
Eternal ID of this version: #1036054/1
Text MD5: edb8ceac1c1b2f8b981bb6b9b471e3e7
Transpilation MD5: 5c23548db3772fa2ce258f9c2fe9ce89
Author: stefan
Category: javax / bit ops
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-03 02:09:37
Source code size: 260 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 121 / 168
Referenced in: [show references]