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

5
LINES

< > BotCompany Repo | #1033645 // roundUpToPowerOfTwo_alternateMethod

JavaX fragment (include)

// not sure if this is faster or slower than main method
static int roundUpToPowerOfTwo_alternateMethod(int v) {
  int i = Int.highestOneBit(v);
  ret v > i ? i << 1 : i;
}

Author comment

Began life as a copy of #1011273

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033645
Snippet name: roundUpToPowerOfTwo_alternateMethod
Eternal ID of this version: #1033645/2
Text MD5: 394ffae8aa9e4109fdf94cefaaf4fe5b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-25 21:42:08
Source code size: 176 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 129 / 153
Version history: 1 change(s)
Referenced in: [show references]