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

9
LINES

< > BotCompany Repo | #1004603 // bitSet - test a bit in int / convert L<Int> to BitSet

JavaX fragment (include)

1  
static bool bitSet(int x, int bit) {
2  
  ret (x & (1 << bit)) != 0;
3  
}
4  
5  
static BitSet bitSet(L<Int> l) {
6  
  new BitSet b;
7  
  for (int i : l) b.set(i);
8  
  ret b;
9  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004603
Snippet name: bitSet - test a bit in int / convert L<Int> to BitSet
Eternal ID of this version: #1004603/1
Text MD5: 07a4ce9a6a51492c6df492d0f5da190d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-03 20:38:46
Source code size: 164 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 544 / 538
Referenced in: [show references]