[sage-support] Re: long arithmetic

2008-10-01 Thread Mike Hansen

Hi Bob,

On Wed, Oct 1, 2008 at 12:01 PM, Bob Wonderly [EMAIL PROTECTED] wrote:
 My follow up question pertains to the patch you'all hurried up to
 create. I know you didn't apply it on my Mac so how do I take advantage
 of it? Do I download the latest version of Sage and install it? The
 version I am using is 3.0.2.

The patch will be in Sage 3.1.3 which will be released this weekend.
You'll probably want to download that when it comes out as there have
been many improvements since 3.0.2.  If you need to use the patch
before then, you can do the following:

1) Start up Sage
2) Run the following command within Sage:
hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/4170/4170-SR-long.patch')
3) Quit Sage
4) Start it back up with sage -br to _build_ and _run_ with the new changes.

--Mike

--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-10-01 Thread Robert Bradshaw

On Oct 1, 2008, at 12:17 PM, Mike Hansen wrote:

 Hi Bob,

 On Wed, Oct 1, 2008 at 12:01 PM, Bob Wonderly  
 [EMAIL PROTECTED] wrote:
 My follow up question pertains to the patch you'all hurried up to
 create. I know you didn't apply it on my Mac so how do I take  
 advantage
 of it? Do I download the latest version of Sage and install it? The
 version I am using is 3.0.2.

 The patch will be in Sage 3.1.3 which will be released this weekend.
 You'll probably want to download that when it comes out as there have
 been many improvements since 3.0.2.  If you need to use the patch
 before then, you can do the following:

 1) Start up Sage
 2) Run the following command within Sage:
 hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/ 
 4170/4170-SR-long.patch')
 3) Quit Sage
 4) Start it back up with sage -br to _build_ and _run_ with the  
 new changes.

Note that if you obtained Sage as a binary, in some cases it may have  
to rebuild the entire library the first time you run sage -br (about  
half an hour, give or take). Subsequent builds will only rebuild the  
touched files (in this case, a matter of a couple of seconds).

- Robert


--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread William Stein

On Mon, Sep 22, 2008 at 6:04 PM, Jason Grout
[EMAIL PROTECTED] wrote:

 Bob Wonderly wrote:
 Using Sage I solved a long list of equations and put the solutions (s)
 in a list; e.g.:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  (q,j,k,s)
 .:
 ([52, 30, 2081203288L], 52, 30, 2081203288L)
 ([53, 53, 17903198518682712L], 53, 53, 17903198518682712L)

 Now I want to plug j and s into the list of y equations so that I can do
 further calculations involving i. But Sage appears to be getting hung on
 the s being long:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i + s
  (j,k,s,y)
 .:
 
 
 TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring' and
 'type 'long''

 When I take the s out of the equation for y it's OK:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i
  (j,k,s,y)
 .:
 (52, 30, 2081203288L, 2147483648*i)
 (53, 53, 17903198518682712L, 18014398509481984*i)

 FWIW:

 sage: type(j), type(k), type(s), type(y), type(i)


 (type 'int',
   type 'int',
   type 'long',
   class 'sage.calculus.calculus.SymbolicArithmetic',
   class 'sage.calculus.calculus.SymbolicVariable')

 None of the tricks I tried have convinced Sage and y that s is OK.


 Can you try converting s to an element that Sage knows by saying:

 y = 2*(2**k)*i + Integer(s)

 That said, I reproduced your error with just:

 sage: var(b)+long(2)

This is a bug, so I've added it to trac:

http://trac.sagemath.org/sage_trac/ticket/4171

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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread Robert Bradshaw

On Sep 22, 2008, at 6:09 PM, William Stein wrote:


 On Mon, Sep 22, 2008 at 6:04 PM, Jason Grout
 [EMAIL PROTECTED] wrote:

 Bob Wonderly wrote:
 Using Sage I solved a long list of equations and put the  
 solutions (s)
 in a list; e.g.:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  (q,j,k,s)
 .:
 ([52, 30, 2081203288L], 52, 30, 2081203288L)
 ([53, 53, 17903198518682712L], 53, 53, 17903198518682712L)

 Now I want to plug j and s into the list of y equations so that I  
 can do
 further calculations involving i. But Sage appears to be getting  
 hung on
 the s being long:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i + s
  (j,k,s,y)
 .:
 
 
 TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring'  
 and
 'type 'long''

 When I take the s out of the equation for y it's OK:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i
  (j,k,s,y)
 .:
 (52, 30, 2081203288L, 2147483648*i)
 (53, 53, 17903198518682712L, 18014398509481984*i)

 FWIW:

 sage: type(j), type(k), type(s), type(y), type(i)


 (type 'int',
   type 'int',
   type 'long',
   class 'sage.calculus.calculus.SymbolicArithmetic',
   class 'sage.calculus.calculus.SymbolicVariable')

 None of the tricks I tried have convinced Sage and y that s is OK.


 Can you try converting s to an element that Sage knows by saying:

 y = 2*(2**k)*i + Integer(s)

 That said, I reproduced your error with just:

 sage: var(b)+long(2)

 This is a bug, so I've added it to trac:

 http://trac.sagemath.org/sage_trac/ticket/4171

... just after I added the ticket here: http://trac.sagemath.org/ 
sage_trac/ticket/4170

- Robert


--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread William Stein

On Mon, Sep 22, 2008 at 6:12 PM, Robert Bradshaw
[EMAIL PROTECTED] wrote:

 On Sep 22, 2008, at 6:09 PM, William Stein wrote:


 On Mon, Sep 22, 2008 at 6:04 PM, Jason Grout
 [EMAIL PROTECTED] wrote:

 Bob Wonderly wrote:
 Using Sage I solved a long list of equations and put the
 solutions (s)
 in a list; e.g.:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  (q,j,k,s)
 .:
 ([52, 30, 2081203288L], 52, 30, 2081203288L)
 ([53, 53, 17903198518682712L], 53, 53, 17903198518682712L)

 Now I want to plug j and s into the list of y equations so that I
 can do
 further calculations involving i. But Sage appears to be getting
 hung on
 the s being long:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i + s
  (j,k,s,y)
 .:
 
 
 TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring'
 and
 'type 'long''

 When I take the s out of the equation for y it's OK:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i
  (j,k,s,y)
 .:
 (52, 30, 2081203288L, 2147483648*i)
 (53, 53, 17903198518682712L, 18014398509481984*i)

 FWIW:

 sage: type(j), type(k), type(s), type(y), type(i)


 (type 'int',
   type 'int',
   type 'long',
   class 'sage.calculus.calculus.SymbolicArithmetic',
   class 'sage.calculus.calculus.SymbolicVariable')

 None of the tricks I tried have convinced Sage and y that s is OK.


 Can you try converting s to an element that Sage knows by saying:

 y = 2*(2**k)*i + Integer(s)

 That said, I reproduced your error with just:

 sage: var(b)+long(2)

 This is a bug, so I've added it to trac:

 http://trac.sagemath.org/sage_trac/ticket/4171

 ... just after I added the ticket here: http://trac.sagemath.org/
 sage_trac/ticket/4170


What's the rule about whose is a dupe then?  I posted on sage-support
first, but you hit new ticket first.I'll let you have the ticket; please
mark mine a dupe.

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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread mabshoff



On Sep 22, 6:17 pm, William Stein [EMAIL PROTECTED] wrote:
 On Mon, Sep 22, 2008 at 6:12 PM, Robert Bradshaw

SNIP

  This is a bug, so I've added it to trac:

 http://trac.sagemath.org/sage_trac/ticket/4171

  ... just after I added the ticket here:http://trac.sagemath.org/
  sage_trac/ticket/4170

 What's the rule about whose is a dupe then?  I posted on sage-support
 first, but you hit new ticket first.    I'll let you have the ticket; please
 mark mine a dupe.

 William

Well, my personal rule is this:

 * ticket with a patch closes other tickets as dupe
 * no patches: earlier ticket stays open *unless* the later ticket has
a much better description

In this case Robert's ticket with patch (that I am currently
doctesting and likely to merge in 10 minutes) wins :)

Cheers,

Michael
--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread Robert Bradshaw

On Sep 22, 2008, at 6:17 PM, William Stein wrote:

 On Mon, Sep 22, 2008 at 6:12 PM, Robert Bradshaw
 [EMAIL PROTECTED] wrote:

 On Sep 22, 2008, at 6:09 PM, William Stein wrote:


 On Mon, Sep 22, 2008 at 6:04 PM, Jason Grout
 [EMAIL PROTECTED] wrote:

 Bob Wonderly wrote:
 Using Sage I solved a long list of equations and put the
 solutions (s)
 in a list; e.g.:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  (q,j,k,s)
 .:
 ([52, 30, 2081203288L], 52, 30, 2081203288L)
 ([53, 53, 17903198518682712L], 53, 53, 17903198518682712L)

 Now I want to plug j and s into the list of y equations so that I
 can do
 further calculations involving i. But Sage appears to be getting
 hung on
 the s being long:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i + s
  (j,k,s,y)
 .:
 
 
 TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring'
 and
 'type 'long''

 When I take the s out of the equation for y it's OK:

 sage: for j in range(52,54,1):
  q = slst[j]
  j=q[0]; k=(q[1]); s=(q[2])
  y = 2*(2**k)*i
  (j,k,s,y)
 .:
 (52, 30, 2081203288L, 2147483648*i)
 (53, 53, 17903198518682712L, 18014398509481984*i)

 FWIW:

 sage: type(j), type(k), type(s), type(y), type(i)


 (type 'int',
   type 'int',
   type 'long',
   class 'sage.calculus.calculus.SymbolicArithmetic',
   class 'sage.calculus.calculus.SymbolicVariable')

 None of the tricks I tried have convinced Sage and y that s is OK.


 Can you try converting s to an element that Sage knows by saying:

 y = 2*(2**k)*i + Integer(s)

 That said, I reproduced your error with just:

 sage: var(b)+long(2)

 This is a bug, so I've added it to trac:

 http://trac.sagemath.org/sage_trac/ticket/4171

 ... just after I added the ticket here: http://trac.sagemath.org/
 sage_trac/ticket/4170


 What's the rule about whose is a dupe then?  I posted on sage-support
 first, but you hit new ticket first.I'll let you have the  
 ticket; please
 mark mine a dupe.

Yeah, I paused long enough to write a patch. I guess this is a good  
kind of problem to have :).

- Robert




--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: long arithmetic

2008-09-22 Thread Jason Grout

William Stein wrote:

 
 What's the rule about whose is a dupe then?  I posted on sage-support
 first, but you hit new ticket first.I'll let you have the ticket; please
 mark mine a dupe.


Hehe...I believe it's the Code talks rule.  Robert has a patch up 
already :).

Jason


--~--~-~--~~~---~--~~
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://www.sagemath.org
-~--~~~~--~~--~--~---