Thread: Random Numbers

  1. #1
    Registered User
    Join Date
    Oct 2003

    Random Numbers

    How does genertating random numbers work? I mean I know what it does, but how can I write a function to generate my own totally random numbers.?

  2. #2

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Ontario, Canada
    Thantos, he's asking how he can generate them on his own, without using the standard rand( ) method.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  4. #4
    Registered User
    Join Date
    Nov 2003
    I think the book called Numerical Recipies talks a lot about this

    in the following link scroll down to chapter 7 to read the pdf files


  5. #5
    Registered User grady's Avatar
    Join Date
    Oct 2003
    This site explains how to use the generator that your compiler's rand() probably implements. However, linear congruential generators are very bad compared to other generators out there.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    It's hard to know whether rand() or prime() has more coverage.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. Doubts regarding random numbers generation
    By girish1026 in forum C Programming
    Replies: 9
    Last Post: 12-31-2008, 10:47 PM
  3. random numbers limit
    By HAssan in forum C Programming
    Replies: 9
    Last Post: 12-06-2005, 07:51 PM
  4. Generate random numbers in Lucky7 project using C#
    By Grayson_Peddie in forum C# Programming
    Replies: 1
    Last Post: 04-11-2003, 11:03 PM
  5. random numbers
    By lil_plukyduck in forum C++ Programming
    Replies: 5
    Last Post: 01-14-2003, 10:14 PM