Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
$urandom_range assigned to 2 variable of same type
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mssajwan  
View profile  
 More options Sep 25 2007, 11:16 am
From: mssajwan <mssaj...@gmail.com>
Date: Tue, 25 Sep 2007 08:16:19 -0700
Local: Tues, Sep 25 2007 11:16 am
Subject: $urandom_range assigned to 2 variable of same type
Hello Friends,
A little doubt, need some clarification.
Within a module I have 2 variables and I assign a range to them
........
.......
int a;
int b;
a = $urandom_range(1,0);
b = $urandom_range(1,0);

....
.............

Now the question is for a particular seed will a & b always have the
same values?
(My assumption is yes,they will always be having same value for
specific seed)

Need your thoughts on it.
Thanks
Manmohan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Essam Arshed  
View profile  
 More options Sep 25 2007, 5:47 pm
From: "Essam Arshed" <essamars...@gmail.com>
Date: Tue, 25 Sep 2007 17:47:23 -0400
Local: Tues, Sep 25 2007 5:47 pm
Subject: Re: $urandom_range assigned to 2 variable of same type

No, I don't think they will have the same value... they may have change to
get same value but not necessarily
try to put the above code in a loop and see

Essam

On 9/25/07, mssajwan <mssaj...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mssajwan  
View profile  
 More options Sep 25 2007, 11:44 pm
From: mssajwan <mssaj...@gmail.com>
Date: Tue, 25 Sep 2007 20:44:04 -0700
Local: Tues, Sep 25 2007 11:44 pm
Subject: Re: $urandom_range assigned to 2 variable of same type
Thanks Essam,

Yes you are right. They will have randomized values.
I tried it yesterday itself.
thanks
Manmohan

On Sep 26, 2:47 am, "Essam Arshed" <essamars...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr. Mala Mitra  
View profile  
 More options Sep 26 2007, 2:33 am
From: "Dr. Mala Mitra" <mala_2001...@yahoo.com>
Date: Tue, 25 Sep 2007 23:33:12 -0700 (PDT)
Local: Wed, Sep 26 2007 2:33 am
Subject: Re: $urandom_range assigned to 2 variable of same type

Hi Manmohan,

  a and b will have different values. As b gets the next random number. But if u put a loop and store all the values of a or b in a file u will find u r getting  same values in all the runs. For example, if in the first run values of a are: 10001100 and b are: 1110011. In the second run also u'll get values of a as: 10001100 and those of b are: 1110011. If u delete the line
  b = $urandom_range(1,0); u'll get 11011 etc. The values of a and b are combined provided u dont change the seed value.

  Best Regards
  --Mala

mssajwan <mssaj...@gmail.com> wrote:

Thanks Essam,

Yes you are right. They will have randomized values.
I tried it yesterday itself.
thanks
Manmohan

On Sep 26, 2:47 am, "Essam Arshed" wrote:

**********************************************************************
Dr. Mala Mitra,
email      : mala_2001...@yahoo.com, mala_2001...@hotmail.com
Phone      : 9845056179 (Mobile).
*********************************************************************

---------------------------------
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hitesh mishra  
View profile  
 More options Sep 26 2007, 3:06 am
From: "hitesh mishra" <mishrahit...@gmail.com>
Date: Wed, 26 Sep 2007 12:36:38 +0530
Local: Wed, Sep 26 2007 3:06 am
Subject: Re: $urandom_range assigned to 2 variable of same type

No they both can't have the same value at  all the seeds.

Regards
Hitesh

On 9/25/07, mssajwan <mssaj...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »