implementation of rand() ?

Discussion in 'C Programming' started by Skybuck Flying, Oct 28, 2004.

  1. Hi,

    What is the implementation of rand() on say visual c/c++ 5 or 6 ?

    Another question... is this rand() implementation the same on any other
    platforms/compilers/libraries ?

    Where can I find/look at the implementation of rand() ?

    Thx for any help.

    Bye,
    Skybuck.
     
    Skybuck Flying, Oct 28, 2004
    #1
    1. Advertising

  2. Skybuck Flying

    Eric Sosman Guest

    Skybuck Flying wrote:
    > Hi,
    >
    > What is the implementation of rand() on say visual c/c++ 5 or 6 ?
    >
    > Another question... is this rand() implementation the same on any other
    > platforms/compilers/libraries ?
    >
    > Where can I find/look at the implementation of rand() ?
    >
    > Thx for any help.


    He's ba-a-a-ck ... (A little Googling of SF's past,
    er, "contributions" is suggested before replying.)

    --
     
    Eric Sosman, Oct 28, 2004
    #2
    1. Advertising

  3. Well I have moved this discussion to sci.crypt etc... since it is more
    relevant there...

    See the thread:

    'Hunt for rand and srand implementations'

    So far I have found no implementations for visual c/c++ 6.0 (I think... I
    should retry the ones I found ;) )

    I did find IBM_AIX and POSIX implementations...

    Any other implementations are welcome especially for redhat, debian, etc...
    I am not sure if those are the same...

    Any links for finding linux source code for those distributions on the web
    like cvs etc are welcome ;)

    Bye,
    Skybuck.
     
    Skybuck Flying, Oct 28, 2004
    #3
  4. Skybuck Flying

    CBFalconer Guest

    Eric Sosman wrote:
    > Skybuck Flying wrote:
    >>

    .... snip ...
    >>
    >> Where can I find/look at the implementation of rand() ?
    >> Thx for any help.

    >
    > He's ba-a-a-ck ... (A little Googling of SF's past,
    > er, "contributions" is suggested before replying.)


    If you hadn't commented I would never have noticed. I wouldn't
    have regretted that either. To the tune of "That's what plonks are
    for".

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
     
    CBFalconer, Oct 28, 2004
    #4
  5. Skybuck Flying

    Randy Howard Guest

    In article <clro54$p5t$1.ov.home.nl>, says...
    > Well I have moved this discussion to sci.crypt etc... since it is more
    > relevant there...


    You having pulling this "verbose mode enabled" thing in various newsgroups
    for years, that's not news.

    >
    > See the thread:
    >
    > 'Hunt for rand and srand implementations'


    Look, if you want a decent random number generator, and you don't
    trust the one that comes with your compiler, google for "mersenne twister".

    If you need one good enough for crypto, that's not it. Instead, take it
    up with the gurus in sci.crypt. Either way, it's OT here.

    > So far I have found no implementations for visual c/c++ 6.0 (I think... I
    > should retry the ones I found ;) )


    The compiler comes with source code for the C runtime library. If you
    installed your compiler with the source (or go back and reinstall it now),
    just like in VC98\CRT\SRC\rand.c under whatever you directory you installed
    the compiler to. You should know this already.

    > I did find IBM_AIX and POSIX implementations...


    You think PRNG's care about the OS?

    > Any other implementations are welcome especially for redhat, debian, etc...
    > I am not sure if those are the same...


    *sigh*

    --
    Randy Howard (2reply remove FOOBAR)
     
    Randy Howard, Oct 28, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skybuck Flying

    rand() implementation

    Skybuck Flying, Oct 28, 2004, in forum: C Programming
    Replies:
    1
    Views:
    8,847
    Thomas Stegen
    Oct 29, 2004
  2. Michael Tsang
    Replies:
    32
    Views:
    1,123
    Richard Bos
    Mar 1, 2010
  3. Michael Tsang
    Replies:
    54
    Views:
    1,204
    Phil Carmody
    Mar 30, 2010
  4. 7stud --

    rand() v. rand(0.1) ?

    7stud --, Sep 15, 2007, in forum: Ruby
    Replies:
    6
    Views:
    236
    Morton Goldberg
    Sep 16, 2007
  5. Simon
    Replies:
    7
    Views:
    435
    Martien Verbruggen
    Mar 2, 2004
Loading...

Share This Page