473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

alternative to rand()

hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.
Nov 14 '05 #1
30 4353
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.


Of course there is. Do some reading about random number generators,
pick an algorithm you'd like to try, learn a programming language,
then implement the algorithm.

If you're looking for a ready-made function, try a google search on
"PRNG source" or "random number generator source."

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #2
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.


Of course there is. Do some reading about random number generators,
pick an algorithm you'd like to try, learn a programming language,
then implement the algorithm.

If you're looking for a ready-made function, try a google search on
"PRNG source" or "random number generator source."

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #3
Sweety wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
There are many alternatives. You can use www.google.com to search for
them on the Web, or groups.google.com to search for both links and code
that have been posted to this newsgroup.
plz reply,
The above line is impolite.
thanks in advance,
The above line is impolite.
bye.


Bye.
Nov 14 '05 #4
Sweety wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
There are many alternatives. You can use www.google.com to search for
them on the Web, or groups.google.com to search for both links and code
that have been posted to this newsgroup.
plz reply,
The above line is impolite.
thanks in advance,
The above line is impolite.
bye.


Bye.
Nov 14 '05 #5
Em Tue, 06 Apr 2004 14:01:47 -0700, Alan Balmer escreveu:
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.

<snip>

This should go to the FAQ, if it isn't already there...
--
José de Paula Rodrigues Neto Assis Linux User 175920
Brasília - DF - Brasil counter.li.org

Nov 14 '05 #6
Em Tue, 06 Apr 2004 14:01:47 -0700, Alan Balmer escreveu:
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.

<snip>

This should go to the FAQ, if it isn't already there...
--
José de Paula Rodrigues Neto Assis Linux User 175920
Brasília - DF - Brasil counter.li.org

Nov 14 '05 #7
sw************@yahoo.co.in (Sweety) writes:
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,


http://benpfaff.org/writings/clc
Nov 14 '05 #8
sw************@yahoo.co.in (Sweety) writes:
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,


http://benpfaff.org/writings/clc
Nov 14 '05 #9
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #10
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #11
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,
The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don't feed it!"
- Anon
Nov 14 '05 #12
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,
The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don't feed it!"
- Anon
Nov 14 '05 #13
Dan Pop wrote:

In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


TALII.

--
Er*********@sun.com
Nov 14 '05 #14
Dan Pop wrote:

In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


TALII.

--
Er*********@sun.com
Nov 14 '05 #15
Dan Pop wrote:

In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


TAPII.

--
Er*********@sun.com
Nov 14 '05 #16
Dan Pop wrote:

In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,


The above line is impolite.


Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


TAPII.

--
Er*********@sun.com
Nov 14 '05 #17
On Tue, 06 Apr 2004 23:23:54 -0300, José de Paula
<jo***********@ig.com.br> wrote:
Em Tue, 06 Apr 2004 14:01:47 -0700, Alan Balmer escreveu:
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.

<snip>

This should go to the FAQ, if it isn't already there...


If you snip everything I wrote, why leave the attribution? You should
have just replied directly to the OP ;-)

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #18
On Tue, 06 Apr 2004 23:23:54 -0300, José de Paula
<jo***********@ig.com.br> wrote:
Em Tue, 06 Apr 2004 14:01:47 -0700, Alan Balmer escreveu:
On 6 Apr 2004 13:51:06 -0700, sw************@yahoo.co.in (Sweety)
wrote:
hello,
Is there any alternative of rand() function i.e i mean any source
avilable to perform same as rand()without using any built in function,
plz reply,
thanks in advance,
bye.

<snip>

This should go to the FAQ, if it isn't already there...


If you snip everything I wrote, why leave the attribution? You should
have just replied directly to the OP ;-)

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #19
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,

The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.


Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #20
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
thanks in advance,

The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.


Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #21
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
> thanks in advance,

The above line is impolite.
Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.

Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.


I'd call it good logic, seeing as the only argument you've presented
for "thanks in advance" being polite is it having an abbreviation.
To make it more clear: "It is such a common courtesy phrase"... It's
certainly common, but why is it a courtesy phrase?
I can't explain why it's *not*, but then, probatio incumbet te, non me.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Show me a good mouser and I'll show you a cat with bad breath."
- Garfield
Nov 14 '05 #22
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Sweety wrote:
> thanks in advance,

The above line is impolite.
Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.


FOAD is also a "standard" abbreviation and I wouldn't call that polite.

Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.


I'd call it good logic, seeing as the only argument you've presented
for "thanks in advance" being polite is it having an abbreviation.
To make it more clear: "It is such a common courtesy phrase"... It's
certainly common, but why is it a courtesy phrase?
I can't explain why it's *not*, but then, probatio incumbet te, non me.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Show me a good mouser and I'll show you a cat with bad breath."
- Garfield
Nov 14 '05 #23
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
>Sweety wrote:
>> thanks in advance,
>
>The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

FOAD is also a "standard" abbreviation and I wouldn't call that polite.

Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.


I'd call it good logic, seeing as the only argument you've presented
for "thanks in advance" being polite is it having an abbreviation.
To make it more clear: "It is such a common courtesy phrase"... It's
certainly common, but why is it a courtesy phrase?


If you *really* can't answer this question, you have a big problem.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #24
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c5**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Dan Pop <Da*****@cern.ch> scribbled the following:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
>Sweety wrote:
>> thanks in advance,
>
>The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

FOAD is also a "standard" abbreviation and I wouldn't call that polite.

Bad logic. FOAD was not supposed to be the abbreviation of a courtesy
phrase in the first place. TIA, was.


I'd call it good logic, seeing as the only argument you've presented
for "thanks in advance" being polite is it having an abbreviation.
To make it more clear: "It is such a common courtesy phrase"... It's
certainly common, but why is it a courtesy phrase?


If you *really* can't answer this question, you have a big problem.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #25
Dan Pop wrote:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:

Sweety wrote:

thanks in advance,


The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan


You may consider my claim incorrect, and welcome "thanks in advance."
That's your privilege.

Nonetheless, the phrase "thanks in advance" presumes an unwarranted
obligation on the part of the person to whom it is addressed.

It is used in Usenet postings by people to avoid responding to help they
may receive. That is actually the wrong lazy approach. The right one
is either not to bother (and I know that probably 90% of the helpful
messages I post are unacknowledged) or to thank all those who have
helped after that help has been given.
Nov 14 '05 #26
Dan Pop wrote:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:

Sweety wrote:

thanks in advance,


The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan


You may consider my claim incorrect, and welcome "thanks in advance."
That's your privilege.

Nonetheless, the phrase "thanks in advance" presumes an unwarranted
obligation on the part of the person to whom it is addressed.

It is used in Usenet postings by people to avoid responding to help they
may receive. That is actually the wrong lazy approach. The right one
is either not to bother (and I know that probably 90% of the helpful
messages I post are unacknowledged) or to thank all those who have
helped after that help has been given.
Nov 14 '05 #27
Em Wed, 07 Apr 2004 08:53:10 -0700, Alan Balmer escreveu:
On Tue, 06 Apr 2004 23:23:54 -0300, José de Paula


<snip> :)

<snip>

This should go to the FAQ, if it isn't already there...


If you snip everything I wrote, why leave the attribution? You should
have just replied directly to the OP ;-)


Errare humanum est.

--
José de Paula Rodrigues Neto Assis Linux User 175920
Brasília - DF - Brasil counter.li.org

Nov 14 '05 #28
On Wed, 07 Apr 2004 16:17:08 -0400, Martin Ambuhl
<ma*****@earthlink.net> wrote:
Dan Pop wrote:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:

Sweety wrote:
thanks in advance,

The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan


You may consider my claim incorrect, and welcome "thanks in advance."
That's your privilege.

Nonetheless, the phrase "thanks in advance" presumes an unwarranted
obligation on the part of the person to whom it is addressed.

It is used in Usenet postings by people to avoid responding to help they
may receive. That is actually the wrong lazy approach. The right one
is either not to bother (and I know that probably 90% of the helpful
messages I post are unacknowledged) or to thank all those who have
helped after that help has been given.


I thought it was a consequence of the usenet custom of discouraging
content-free postings such as "Thanks", and "Me too."

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #29
In article <c5*************@ID-227552.news.uni-berlin.de>, Martin Ambuhl wrote:
Dan Pop wrote:
In <c4*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:

Sweety wrote:
thanks in advance,

The above line is impolite.

Bullshit. It is such a common courtesy phrase that it even has a
"standard" abbreviation: TIA.

Dan


You may consider my claim incorrect, and welcome "thanks in advance."
That's your privilege.

Nonetheless, the phrase "thanks in advance" presumes an unwarranted
obligation on the part of the person to whom it is addressed.

It is used in Usenet postings by people to avoid responding to
help they may receive. That is actually the wrong lazy
approach. The right one is either not to bother (and I know
that probably 90% of the helpful messages I post are
unacknowledged) or to thank all those who have helped after
that help has been given.


I agree. The thing to do at the end of a detailed question is to
thank people for *reading* it.

--
Neil Cerutti
"We have to show some respect for the dead!"
"Why? The dead are losers."
-- _Children Shouldn't Play with Dead Things_
Nov 14 '05 #30
In <c5*************@ID-227552.news.uni-berlin.de> Martin Ambuhl <ma*****@earthlink.net> writes:
Nonetheless, the phrase "thanks in advance" presumes an unwarranted
obligation on the part of the person to whom it is addressed.
1. On Usenet, posts are not addressed to any particular person. It's
an abbreviation for "thanks in advance to whomever might reply to my
question" and there is no unwarranted obligation towards anyone
presumed.

2. In real life interactions, it is not uncommon for polite persons to
say "thank you" (honestly, not sarcastically) even when the other
person could not provide any help. This debunks your interpretation
even for the cases when TIA is used in private email.
It is used in Usenet postings by people to avoid responding to help they
may receive.


I find followups along the lines of "thank you to all those who
answered my question" a lot more obnoxious.

Personally, I prefer the simpler "thanks" formula. It can be interpreted
as "thanks for reading my post" by those who don't intend to reply and
as "thanks for answering my post" by those who post helpful replies :-)

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #31

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Tom McCallum | last post by:
Can any tell me why rand() is such a bad pseudo-random number generator. In all the articles I have read they say that you can predict the outcome of rand() but when I used its output with NIST's...
2
by: Kristofer Berggren | last post by:
Hi, I'm developing a simple application which uses rand() frequently, and I was just wondering if there are any alternatives to generating random numbers other than the in-built function in C?...
0
by: Sweety | last post by:
hello, Is there any alternative of rand() function i.e i mean any source avilable to perform same as rand()without using any built in function, plz reply, thanks in advance, bye.
36
by: Profetas | last post by:
Hi, I want to generate a random 8 bit number using rand(0 is that possible? to expecifu the base and the lenght? thanks
8
by: Jack | last post by:
When I use rand(), is the RAND_MAX value how long I am guaranteed that the same value will not appear twice? And is this a floating window? For example, if RAND_MAX is 32767, and I make...
4
by: Siam | last post by:
Hi all, I'm writing a shell language in c++ that supports the generation of random numbers, and by its nature, each command must be executed in a new thread. The call to the random function from...
5
by: ds | last post by:
Hi all, rand() is not thread safe, a fact that may not be so bad after all.. However, I face the following problem: a piece of code uses rand() to get a random sequence, but always seeds with...
10
by: Rafael Cunha de Almeida | last post by:
Hi, I've found several sites on google telling me that I shouldn't use rand() % range+1 and I should, instead, use something like: lowest+int(range*rand()/(RAND_MAX + 1.0))
15
by: Rich Fife | last post by:
Quick rand() question: I know you're not supposed to use "rand() % 1024" for instance, because it focuses on the lower bits. However, it seems to me that given that the argument is not a power...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.