random

  1. LucaMs

    Android Code Snippet [B4X] RndPositiveLong - Generates a random POSITIVE Long

    Cross‑platform random 62‑bit generator (non‑negative values from 0 to 2^62−1), 'Generates a random non-negative Long number. Public Sub RndPositiveLong As Long ' Generates two random Ints up to 2^31−1 and combines them. Dim High As Long = Rnd(0, 2147483647) ' 31 bits Dim Low As...
  2. behnam_tr

    B4J Question Random Float Numbers ??

    I didn't find any method to generate Random Float numbers between 0 and 1 Is there such a method? i need simulate this java script code Math.floor((Math.random() * 10000000)+1); Math.random() in java script >>> 0.1142937586695465 , 0.9373901332670653 , 0.7550847537693961
  3. LucaMs

    B4A Class [B4X] Class - clsRndItems

    A simple class for randomly picking items from a group without repetitions (but also with repetitions, if desired). It works on all platforms (B4A, B4J, B4I), of course. Main methods: Initialize(..., NumOfItems As Int) Creates, by default, a list of numeric items, from 1 to NumOfItems you...
  4. Myr0n

    Android Code Snippet Get Random Numbers in a non repeating list

    The next code snippet, return a list with non repeating random numbers Feel free to modify or use it as you want. This code depends on JavaObject and Inline Java Code usage. I decide to use the inline java because the Core random function (RND) get stuck at some point, I do not have the Core...
Top