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

9
LINES

< > BotCompany Repo | #1033690 // powersOfTwoUpTo

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

Transpiled version (4937L) is out of date.

static L<Int> powersOfTwoUpTo(int firstPowerOfTwo default 1, int n) {
  new IntBuffer l;
  int i = firstPowerOfTwo;
  while (i <= n && i > 0) {
    l.add(i);
    i *= 2;
  }
  ret l.asVirtualList();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033690
Snippet name: powersOfTwoUpTo
Eternal ID of this version: #1033690/2
Text MD5: daf77af51f22c93ec0754cfca80a86d0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-30 14:07:12
Source code size: 208 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 137 / 213
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1035787 - firstNCubes - 1, 8, 27 etc