About rand

This is a discussion on About rand within the C++ Programming forums, part of the General Programming Boards category; Hi all What algorithm is used in the built-in function rand() in C? Thanks in advance Fred...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    1

    About rand

    Hi all

    What algorithm is used in the built-in function rand() in C?

    Thanks in advance
    Fred

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    > What algorithm is used in the built-in function rand() in C?
    It's random
    The standard doesn't specify a particular algorithm, so even from the same seed, two different implementations can return different results.

    Most tend to be variants of
    http://random.mat.sbg.ac.at/~charly/server/node3.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. rand() implementation
    By habert79 in forum C Programming
    Replies: 4
    Last Post: 02-07-2009, 12:18 PM
  2. Wm_timer
    By Ducky in forum Windows Programming
    Replies: 21
    Last Post: 09-26-2008, 05:36 AM
  3. Issue w/ Guess My Number Program
    By mkylman in forum C++ Programming
    Replies: 5
    Last Post: 08-23-2007, 01:31 AM
  4. rand() to choose?
    By wagman in forum C++ Programming
    Replies: 2
    Last Post: 03-27-2002, 12:43 AM
  5. rand () a little confusion
    By Led Zeppelin in forum C Programming
    Replies: 3
    Last Post: 03-19-2002, 09:13 PM

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