how can i write C code that generate random number without using built in code

Discussion in 'C Programming' started by Sweety, Apr 4, 2004.

  1. Sweety

    Sweety Guest

    plz reply,
    thanks in advance.
    bye
    Sweety, Apr 4, 2004
    #1
    1. Advertising

  2. Sweety

    Tom St Denis Guest

    Sweety wrote:

    > plz reply,
    > thanks in advance.
    > bye


    HOMEWORK QUESTION
    Tom St Denis, Apr 4, 2004
    #2
    1. Advertising

  3. Re: how can i write C code that generate random number without usingbuilt in code

    Sweety wrote:
    > plz reply,
    > thanks in advance.
    > bye

    You cannot generate truly random numbers (without an external device) in
    the mathematical sense of the word. You can only generate pseudorandom
    numbers. For the discussion, google the topics "alternative rand()", etc.

    My favourie, although very slow method for generating a sequence of
    pseudorandoms in the interval [0,1] is

    next_number := after_comma_part_of ((Pi+previous_number)^5)


    --
    Best regards,
    Alex.

    PS. To email me, remove "loeschedies" from the email address given.
    Alexander Malkis, Apr 4, 2004
    #3
  4. Em Sun, 04 Apr 2004 20:03:48 +0000, Tom St Denis escreveu:

    > Sweety wrote:
    >
    >> plz reply,
    >> thanks in advance.
    >> bye

    >
    > HOMEWORK QUESTION


    What question? I don't see any question.

    --
    Quidquid latine dictum sit altum viditur
    =?iso-8859-1?q?Jos=E9_de_Paula?=, Apr 4, 2004
    #4
  5. Richard Heathfield, Apr 4, 2004
    #5
  6. Sweety

    Ben Pfaff Guest

    Re: how can i write C code that generate random number withoutusing built in code

    http://benpfaff.org/writings/clc
    --
    "The way I see it, an intelligent person who disagrees with me is
    probably the most important person I'll interact with on any given
    day."
    --Billy Chambless
    Ben Pfaff, Apr 4, 2004
    #6
  7. Sweety

    CBFalconer Guest

    Re: how can i write C code that generate random number without usingbuilt in code

    Sweety wrote:
    >
    > plz reply,


    Oh very well.

    --
    A: Because it fouls the order in which people normally read text.
    Q: Why is top-posting such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    CBFalconer, Apr 5, 2004
    #7
    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. Matt
    Replies:
    24
    Views:
    9,339
    Malcolm
    Oct 18, 2004
  2. globalrev
    Replies:
    4
    Views:
    742
    Gabriel Genellina
    Apr 20, 2008
  3. Peng Yu
    Replies:
    23
    Views:
    533
    Ted Zlatanov
    Jun 29, 2010
  4. VK
    Replies:
    15
    Views:
    1,116
    Dr J R Stockton
    May 2, 2010
  5. Kenz09
    Replies:
    3
    Views:
    76
    Dave Angel
    Jul 8, 2013
Loading...

Share This Page