Hi, Either sxrange or srange should do the trick :)
sage: sxrange(0,1,0.1) <generator object generic_xsrange at 0x5884820> sage: srange(0,1,0.1) [0.000000000000000, 0.100000000000000, 0.200000000000000, 0.300000000000000, 0.400000000000000, 0.500000000000000, 0.600000000000000, 0.700000000000000, 0.800000000000000, 0.900000000000000] sage: srange(0,1,1/10) [0, 1/10, 1/5, 3/10, 2/5, 1/2, 3/5, 7/10, 4/5, 9/10] On Mon, Mar 28, 2011 at 7:28 PM, ObsessiveMathsFreak < [email protected]> wrote: > This is a simple question, but I can't find anything in the > documentation about it. > > I would like to declare a simple arithmetic sequence in sage. I use > this a lot for discrete plots, etc. In octave, syntax such as > [0:0.1:1] returns the sequence > > 0.0 0.2 0.4 0.6 0.8 1.0 > > Is there such a shorthand syntax for these kinds of sequences in sage? > I know about the shorthand [1..10] for integers, but this does not > seem to work for general arithmetic sequences. The range() function > also will not work correctly with non integer steps. > > -- > 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-support > URL: http://www.sagemath.org > -- Tim Joseph Dumol <tim (at) timdumol (dot) com> http://timdumol.com -- 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-support URL: http://www.sagemath.org
