RE: net.sf.saxon.exslt.Random
"Michael Kay" <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <[email protected]> |
A couple of questions (copy to the exslt list): What does the signature random:random-sequence(number?, number?) mean? Does it mean that the function can have 0, 1, or 2 arguments, or does it mean that the arguments can be ()? I guess the former, since () wasn't invented in 1.0. So if it has one argument, is this the number of items to be returned, or the seed? The spec doesn't seem to say. Your implementation makes it the seed. Your implementation accepts a seed that's a long. This means that supplying 0.1 and 0.2 will give you the same sequence. This doesn't feel right; I think it should be a double. I've done some internal changes to make it return values in Saxon's internal data formats to avoid the need for subsequent conversion. Ideally I would make it return an iterator, in which case the sequence could be infinite, but then I'd need somewhere to keep the current state, which is tricky. Michael Kay > -----Original Message----- > From: Martin Szugat [mailto:[email protected]] > Sent: 30 June 2004 19:28 > To: [email protected] > Subject: net.sf.saxon.exslt.Random > > Attached you'll find a ZIP archive with an Eclipse 3.0 > project including > the source code for the net.sf.saxon.exslt.Random class and a > corresponding test case called RandomTest. The test is repeated 400 > times and ensure that > > - the random number lies between 0 (inclusive) and 1 (exclusive) > - for the same seed the same random numbers are generated > - for different seeds, different random numbers are generated > > I'll hope you'll find it useful! If so, please notify me when you > integrated it, so I can mention it in my article. > > Greetings, > > Martin > > PS: If you have some suggestions how to improve the code or something > isn't good enough, feel free to contact me! I'll fix it :) > > > -----Ursprüngliche Nachricht----- > > Von: SourceForge.net [mailto:[email protected]] > > Gesendet: Mittwoch, 30. Juni 2004 19:37 > > An: [email protected] > > Betreff: [saxon - Help] RE: random in loop returns same > number each t > > > > > > > > Read and respond to this message at: > > https://sourceforge.net/forum/message.php?msg_id=2643233 > > By: mhkay > > > > Just send it in when it's tested and I'll integrate it. > > Remember to send the test cases too. If you can devise a way > > of making the test repeatable (so it gives the same results > > each time) that will help the regression testing no end. > > > > Michael Kay > > > > > ______________________________________________________________________ > > You are receiving this email because you elected to monitor > > this forum. To stop monitoring this forum, login to > > SourceForge.net and visit: > > https://sourceforge.net/forum/unmonitor.php?forum_id=94027 > > >