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

5
LINES

< > BotCompany Repo | #1036545 // mod_31bit

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

Libraryless. Click here for Pure Java version (35L/1K).

// use it only on inputs that are random ints
// always gives a positive number
static int mod_31bit(int n, int m) {
  ret (n & 0x7FFFFFFF) % m;
}

Author comment

Began life as a copy of #1002512

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036545
Snippet name: mod_31bit
Eternal ID of this version: #1036545/1
Text MD5: 03c2e6fa83b8b99824979437bfa649b3
Transpilation MD5: 1dfbcb09cac6b2d90c8d917423714c24
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-02-12 14:43:06
Source code size: 150 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 149 / 207
Referenced in: #761 - New #629 - Standard functions list (LIVE) - continued on #1006654