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)

static bool bitSet(int x, int bit) {
  ret (x & (1 << bit)) != 0;
}

static BitSet bitSet(L<Int> l) {
  new BitSet b;
  for (int i : l) b.set(i);
  ret b;
}

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: 543 / 537
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1012916 - bitClear - test if a bit in int is 0