On 6/12/07, Liran Orevi <\> wrote: > Hello, > > 1)I've wanted to write this on Sage-Trac but have no user. > > 2)Sage crashes on: > > sage: for i in range(1,6,0.2): > ... print i > > Wheras in phyton: > > >>>for i in range(3,7,0.2): > ... a=5 > ... > __main__:1: DeprecationWarning: integer argument expected, got float > Traceback (most recent call last): > File "<stdin>", line 1, in ? > ValueError: range() step argument must not be zero > >>>
In python the range function's third input must be a nonzero integer, as the second error shows. In SAGE I get exactly the same error as you attribute above to Python, so I'm not sure why you claim SAGE crashes: sage: for i in range(1,6,0.2): ....: print i ....: --------------------------------------------------------------------------- <type 'exceptions.ValueError'> Traceback (most recent call last) /Users/was/<ipython console> in <module>() <type 'exceptions.ValueError'>: range() step argument must not be zero ------------ Second, you should use the SAGE 'srange' command for this sort of thing -- it is like the Python range command, but much more flexible: sage: for i in srange(1,6,0.2): ....: print i ....: 1 1.20000000000000 1.40000000000000 1.60000000000000 1.80000000000000 2.00000000000000 2.20000000000000 > 3)I've noticed similarity to > http://www.sagemath.org:9002/sage_trac/ticket/215 That trac was that the line "pari(2.5) > None" crashed. It doesn't crash anymore though: sage: pari(2.5) > None False > 4)I'm running Ubuntu 6.06 (linux-based). Hmm. Above I'm basically responding that I can't replicate any of the problems that you're having. Maybe you could clarify: (1) the exact version of SAGE you're using and how you installed it, (2) your CPU type (3) and give a complete console log starting with you typing "sage" and illustrating each of the problems you have. William --~--~---------~--~----~------------~-------~--~----~ 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/ -~----------~----~----~----~------~----~------~--~---