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

3
LINES

< > BotCompany Repo | #1030522 // dualLog - dual logarithm (base 2), rounded up [is it called "binary logarithm"?]

JavaX fragment (include)

static int dualLog(int i) {
  ret 32-Int.numberOfLeadingZeros(max(0, i-1));
}

Author comment

Began life as a copy of #1028514

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt, wnsclhtenguj

No comments. add comment

Snippet ID: #1030522
Snippet name: dualLog - dual logarithm (base 2), rounded up [is it called "binary logarithm"?]
Eternal ID of this version: #1030522/2
Text MD5: e091d3b606d1f292387ba9f779deee5b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-14 21:59:02
Source code size: 79 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 159 / 199
Version history: 1 change(s)
Referenced in: [show references]