Re: [math] MersenneTwister question

2011-09-09 Thread Greg Sterijevski
Added short comment. -Greg On Tue, Aug 30, 2011 at 5:37 AM, sebb wrote: > On 29 August 2011 07:11, Greg Sterijevski wrote: > > My apologies, I was looking at the original c code and neglected to > notice > > the cast. > > Perhaps add a comment to the cast to make it clearer? > > > On Mon, Aug 2

Re: [math] MersenneTwister question

2011-08-30 Thread Greg Sterijevski
Yes, I think this is a good idea. I will do it. On Tue, Aug 30, 2011 at 5:37 AM, sebb wrote: > On 29 August 2011 07:11, Greg Sterijevski wrote: > > My apologies, I was looking at the original c code and neglected to > notice > > the cast. > > Perhaps add a comment to the cast to make it clearer

Re: [math] MersenneTwister question

2011-08-30 Thread sebb
On 29 August 2011 07:11, Greg Sterijevski wrote: > My apologies, I was looking at the original c code and neglected to notice > the cast. Perhaps add a comment to the cast to make it clearer? > On Mon, Aug 29, 2011 at 12:56 AM, Greg Sterijevski > wrote: > >> Yes, you seem to have a good point. M

Re: [math] MersenneTwister question

2011-08-28 Thread Greg Sterijevski
My apologies, I was looking at the original c code and neglected to notice the cast. On Mon, Aug 29, 2011 at 12:56 AM, Greg Sterijevski wrote: > Yes, you seem to have a good point. My bad. > > On Mon, Aug 29, 2011 at 12:50 AM, Ted Dunning wrote: > >> Why? >> >> Isn't that what casting as an (int)

Re: [math] MersenneTwister question

2011-08-28 Thread Greg Sterijevski
Yes, you seem to have a good point. My bad. On Mon, Aug 29, 2011 at 12:50 AM, Ted Dunning wrote: > Why? > > Isn't that what casting as an (int) does? > > On Sun, Aug 28, 2011 at 10:17 PM, Greg Sterijevski > wrote: > > > While probably not a big deal, shouldn't the initial element in the array >

Re: [math] MersenneTwister question

2011-08-28 Thread Ted Dunning
Why? Isn't that what casting as an (int) does? On Sun, Aug 28, 2011 at 10:17 PM, Greg Sterijevski wrote: > While probably not a big deal, shouldn't the initial element in the array > mt > be 'anded' by 0xL? > > mt[0]= (int) longMT & 0xL; >

[math] MersenneTwister question

2011-08-28 Thread Greg Sterijevski
Hello All, In the MersenneTwister implementation in commons, I notice the following: @Override public void setSeed(int seed) { // we use a long masked by 0xL as a poor man unsigned int long longMT = seed; mt[0]= (int) longMT; for (mti = 1; mti < N;