<< Actually in this part I was suggesting that it might be a simple typo in the _smalltalk_ and that by comparing the results of the shifts & masks in C with those in Smalltalk you could probably find out something. >>
Oh! Now I understand. All I can tell you is that I actually took the C code and pasted it, verbatim, into the first Smalltalk method. Since this stuff is mostly bit operations, I only had to replace C tokens like '^' with 'bitXOr:' and so on. This approach was an attempt to avoid typographical errors up front.
Since then I have poured over the C and Smalltalk code in parallel and just can't find a single discrepency. Then again, the hardest task is to find fault in one's own work...
<< I'm just looking at making a little plugin of it and wondering which of the varieties of numbers one really wants. The C file I downloaded seems to offer:- array initialisation of seeds plain init of seeds 32 bit int result 0 to 16rFFFFFFFF 31 bit 0 to 16r7FFFFFFF three different reals, [0,1], [0,1), (0,1) and [0,1) 53 bit resolution.
Obviously the simplest would be to drop everything but the plain init and 32 bit int result. One might reasonably cut it to 30bit positive SmallInteger results. >>
I am new to the idea of plugins. I suspect that they are a mechanism to take a foreign code (like these C programs), in whole or in part, and encapsulate it with a Smalltalk interface. Yes?
<< What would be most useful? >>
I really appreciate your help on this problem but I honestly do not have a clue how to answer this question.
-Mark
Mark4Flies@aol.com is claimed by the authorities to have written:
Since then I have poured over the C and Smalltalk code in parallel and just can't find a single discrepency. Then again, the hardest task is to find fault in one's own work...
Absolutely; thus the virtues of code reviews, pair programmming, open source etc.
I am new to the idea of plugins. I suspect that they are a mechanism to take a foreign code (like these C programs), in whole or in part, and encapsulate it with a Smalltalk interface. Yes?
Sort of. Go to the swiki (http://http://minnow.cc.gatech.edu/squeak.1 and look up 'plugins' for more than you probably want to know.
<< What would be most useful? >>
I really appreciate your help on this problem but I honestly do not have a clue how to answer this question.
Then we must hope that somebody who is really keen on random numbers is listening and can offer us both some asistance!
tim
On Wed, 31 Jul 2002, Tim Rowledge wrote:
Mark4Flies@aol.com is claimed by the authorities to have written:
Since then I have poured over the C and Smalltalk code in parallel and just can't find a single discrepency. Then again, the hardest task is to find fault in one's own work...
Absolutely; thus the virtues of code reviews, pair programmming, open source etc.
[snip]
Well, I'm probably jumping in at the wrong place, as usual, but I was a little surprised that Besset didn't have the Mersenne Twister. I still point you to "Object-Oriented Implemention of Numerical Methods".
There's also David N. Smith's code: http://www.dnsmith.com/Squeak/index.html
Isn't that a port of the Mersenne Twister C code? Am I totally lost?
Oh well, repetition is the key to humor. So either I've been informative, or funny :)
Cheers, Bijan Parsia.
squeak-dev@lists.squeakfoundation.org