About 10,400,000 results
Open links in new tab
  1. How do I get a specific range of numbers from rand ()?

    Jul 30, 2009 · Here is my answer there, which contains the definition for my int utils_rand(int min, int max) func, which returns a random number using rand() which is in the specific range from …

  2. c++ - How does modulus and rand () work? - Stack Overflow

    Oct 24, 2013 · A second lesson is that this shows another way in which <random> is easier to use than rand() and manually computing your own distributions. The built-in …

  3. Getting random numbers in Java - Stack Overflow

    I would like to get a random value between 1 to 50 in Java. How may I do that with the help of Math.random();? How do I bound the values that Math.random() returns?

  4. How do I generate a random integer in C#? - Stack Overflow

    { Random rand = new Random((int)DateTime.Now.Ticks); return rand.Next(min, max); } if you are looking for random number generator for normal distribution, you might use a Box-Muller …

  5. Random number c++ in some range - Stack Overflow

    Possible Duplicate: Generate Random numbers uniformly over entire range I want to generate the random number in c++ with in some range let say i want to have number between 25 and 63. …

  6. Generate a value between 0.0 and 1.0 using rand () - Stack Overflow

    The OP's reasoning for trying it was wrong, but had this been necessary, the UB could've been avoided by adding 1.0 instead of 1, which would coerce RAND_MAX to double type and so …

  7. How to generate a random int in C? - Stack Overflow

    Aug 4, 2015 · The difference between rand and random is that random returns a much more usable 32-bit random number, and rand typically returns a 16-bit number. The BSD manpages …

  8. ¿Cómo generar números aleatorios con srand y rand en C dentro …

    Oct 12, 2020 · Y con dado = 1 + rand() % 6 puedo generar un número aleatorio entre 1 y 6 para la variable dado. No entendí el razonamiento para llegar a la fórmula de dado pero funciono. …

  9. How does rand() work in C? - Stack Overflow

    Oct 28, 2015 · How does rand () work in C? [closed] Asked 10 years ago Modified 5 years, 6 months ago Viewed 33k times

  10. clarification for RAND_MAX and rand () in c stdlib.h

    Aug 28, 2018 · RAND_MAX is an integral constant, but you are printing it using the %f specifier (used for double), which is undefined behavior (and in your case happens to print 0).