On 9/19/07, Jaap Spies <[EMAIL PROTECTED]> wrote: > William, > > After the discussion in the thread 'Calculus' I added the function > irange(start, stop, step=1) to misc/misc.py. > > I think this could be a good replacement of the operator '..' > known in Maple and Matlab. Better since it allows steps to be > different from 1.
There is a already a function srange in misc.py like this: def srange(a,b=None,step=1, include_endpoint=False): What does your irange do differently? And why the i? Does it mean "include" endpoints? That makes sense actually. I would like to see a version in Cython that is blazingly fast, so I'm cc'ing this to sage-devel for feedback. > The Maple expression: seq(n^2, n=-1..10) has an equivalent > sage: [n^2 for n in irange(-1, 10)] > [1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100] > > Maybe we can think of a better name. It's better than any I thought of so far. > > Cheers, > > Jaap > > > [EMAIL PROTECTED] sage-2.8.4.2]$ ./sage -t devel/sage-main/sage/misc/misc.py > sage -t devel/sage-main/sage/misc/misc.py > [2.0 s] > > ---------------------------------------------------------------------- > All tests passed! > Total time for all tests: 2.0 seconds > [EMAIL PROTECTED] sage-2.8.4.2]$ > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] 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/ -~----------~----~----~----~------~----~------~--~---
