About 524,000 results
Open links in new tab
  1. How does Math.random() work in javascript? - Stack Overflow

    Nov 20, 2013 · Math.random () returns a Number value with a positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform …

  2. java - Math.random () explanation - Stack Overflow

    Nov 1, 2011 · This is a pretty simple Java (though probably applicable to all programming) question: Math.random() returns a number between zero and one. If I want to return an integer …

  3. Generate random number between two numbers in JavaScript

    Feb 11, 2011 · Is there a way to generate a random number in a specified range with JavaScript ? For example: a specified range from 1 to 6 were the random number could be either 1 ...

  4. Javascript: Math.random - Stack Overflow

    Oct 14, 2012 · Since Math.random returns a real number between [0,1) (1 is not inclusive), multiplying the result returns a real number between [0, 52). Since you are flooring the result, …

  5. How random is JavaScript's Math.random? - Stack Overflow

    Jun 30, 2009 · The following paper explains how math.random () in major Web browsers is (un)secure: "Temporary user tracking in major browsers and Cross-domain information …

  6. Random numbers with Math.random() in Java - Stack Overflow

    Oct 27, 2011 · 2 If min = 5, and max = 10, and Math.random() returns (almost) 1.0, the generated number will be (almost) 15, which is clearly more than the chosen max. Relatedly, this is why …

  7. How do i use math.random with decimals - Roblox

    Aug 10, 2025 · Hello! I am using math.random () for uis. But instead of returning 1,2, or 3, I want to make it return decimal numbers like 1.2,2.1, etc So, how do i make that?

  8. Generating random whole numbers in JavaScript in a specific range

    Oct 7, 2009 · How can I generate random whole numbers between two specified variables in JavaScript, e.g. x = 4 and y = 8 would output any of 4, 5, 6, 7, 8?

  9. How do I use math.random - Community Tutorials - Roblox

    Mar 22, 2023 · math.random(a,b) generates a random number between a and b. math.random() returns a number between 0 and 1. That’s really all you need to know.

  10. How do you use math.random to generate random ints?

    Dec 23, 2011 · How do you use Math.random to generate random ints? My code is: int abc= (Math.random ()*100); System.out.println (abc); All it prints out is 0, how can I fix this?