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

8
LINES

< > BotCompany Repo | #1024425 // randomInt - out of full int range (including negative values) + more syntax

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

Libraryless. Click here for Pure Java version (4667L/26K).

static int randomInt(optional Random random) {
  ret getRandomizer(random).nextInt();
}

// return value between 0 and n-1
static int randomInt(optional Random random, int n) {
  ret random(random, n);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1024425
Snippet name: randomInt - out of full int range (including negative values) + more syntax
Eternal ID of this version: #1024425/9
Text MD5: fd8537e31ae645e8bcdc5d1bd714120c
Transpilation MD5: 62881107ff58468417609bfe26211e5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-06 23:10:36
Source code size: 210 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 320 / 417
Version history: 8 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025073 - randomShort - out of full short range (including negative values)
#1029053 - randomByte - out of full byte range (including negative values)
#1029054 - randomLong