Random Numbers

This is a discussion on Random Numbers within the C Programming forums, part of the General Programming Boards category; How does genertating random numbers work? I mean I know what it does, but how can I write a function ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    104

    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
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    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
    Posts
    46
    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

    http://www.library.cornell.edu/nr/bookcpdf.html

    -Peter

  5. #5
    Registered User grady's Avatar
    Join Date
    Oct 2003
    Posts
    27
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    http://directory.google.com/Top/Comp..._Numbers/?tc=1
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so 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, 09:47 PM
  3. random numbers limit
    By HAssan in forum C Programming
    Replies: 9
    Last Post: 12-06-2005, 06: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, 09:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21