On 5/27/07, Ted Kosan <[EMAIL PROTECTED]> wrote:
> 1) In Mathematica there is a Clear function that is used to clear
> variables and an example is Clear [ f, x ].  Is there an equivalent
> function in Sage that does this?  I have been using the var function
> to clear variables but I was wondering if Sage contained a function
> like Clear that was more intuitive.

(1) Use the function "restore" to restore a variable to what it was when
SAGE started.  Type restore? to see how.

sage: x = 5; f = 10
sage: x, f
(5, 10)
sage: restore('x f')
sage: x, f
(x, f)

(2) Use "del varname" to delete the given variable completely.

(3) Use reset() to restore *all* variables to how they were when SAGE
started.

> 2) In the tutorial, I want to cover using Sage to work with different
> number bases.  I have found that the following code provides a nice
> general way to convert base(n) string numbers into Integers:
>
> x = Integer( '10100101', 2)
>
> but I have not yet found a general way to convert Integers to base(n)
> string numbers.  Does anyone know of a general way to do this?
>
> I think the binary method in the Integer class is close to what I am
> looking for and I think that having a more general base(n) method in
> the Integer class that works similarly to it would be useful.
>
> Thanks in advance,

By the way, I hope you'll consider letting us distribute your tutorial
too when it is done.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to