On Oct 8, 2007, at 9:34 AM, cwitty wrote:
> > On Oct 8, 7:36 am, "William Stein" <[EMAIL PROTECTED]> wrote: >> I do encourage David to open a trac ticket about this. He's right >> that >> seeding the random number generator should be possible via a command >> line argument at startup. > > But which random number generator? libc, Python, libpari, NTL, > libgmp... not counting the many subprocesses that have their own > random number generator. > > I have a rough proposal to try to bring some order to this mess. > Randomness in SAGE should be centered in a "randgen" object. There is > a global default randgen, but others can be created. All algorithms > that use random numbers should take an optional randgen parameter, and > use the numbers from there. The numbers from a randgen would be > portable across architectures. On the face of it, I think it's a good idea. It's worth pursuing, at least until we have an idea of what the impact is likely to be. +1 On Oct 8, 2007, at 10:10 AM, William Stein wrote: > True. However, a few days ago I realized there is a much better > solution to this problem. Use ... in the output. E.g., instead > of something like > > sage: sin(1.0) # random low-order bits > 0.841470984807897 > > we do > > sage: sin(1.0) > 0.8414709848078... This sounds good, but what about "piping" issues (take the print output of one function and give it as input to another)? Currently, we get sage: xxx= 0.8414709848078... ------------------------------------------------------------ File "<ipython console>", line 1 xxx= RealNumber('0.8414709848078E')llipsis ^ <type 'exceptions.SyntaxError'>: invalid syntax I often copy/paste between windows running different SAGEs, or even print to files and read back, so this isn't entirely bogus. Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for the Absorption of Federal Funds -------- If you're not confused, You're not paying attention -------- --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---