// 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; }
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: | 130 / 155 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |