[sage-devel] Re: int floor division

2011-01-20 Thread Eviatar
Hello, I was suggesting it for inclusion in Sage, both to ease the transition to Python 3 and to make its behaviour more appropriate for a CAS. However, as some users have pointed out, it does not maintain precision, and it is still used by some for floor division. Perhaps it is not yet ready. --

Re: [sage-devel] Re: int floor division

2011-01-19 Thread Tom Boothby
On Wed, Jan 19, 2011 at 2:37 PM, Eviatar wrote: > An alternative would be to make standard Python functions (such as > count) return Integer objects, but this would make it incompatible > with vanilla Python. -1, think of the effort involved, and the performance hit we'd take -- To post to this

[sage-devel] Re: int floor division

2011-01-19 Thread Eviatar
An alternative would be to make standard Python functions (such as count) return Integer objects, but this would make it incompatible with vanilla Python. On Jan 18, 11:33 pm, Nils Bruin wrote: > On Jan 18, 1:20 am, Simon King wrote: > > > On the other hand, eventually we will have Python 3.*, a

Re: [sage-devel] Re: int floor division

2011-01-19 Thread Tom Boothby
On Tue, Jan 18, 2011 at 11:33 PM, Nils Bruin wrote: > Python 3's division for integers is quite unsuitable for a computer > algebra system. Python 2's division for integers is also quite unsuitable for a computer algebra system: >>> 1/2 0 But Sage fixes this: sage: 1/2 1/2 Since floor divisio

[sage-devel] Re: int floor division

2011-01-18 Thread Nils Bruin
On Jan 18, 1:20 am, Simon King wrote: > On the other hand, eventually we will have Python 3.*, and thus why > should I not get used to write int(i/j) instead of i/j, for `int`s i > and j? Because it can give the wrong answer :-). In Python 3: >>> int(10**40/10**10) 1198846248386

[sage-devel] Re: int floor division

2011-01-18 Thread Eviatar
Oh, I wasn't aware people actually used this for floor division, I had assumed everyone used //. I guess it wouldn't be good to change it now then. When is the change to Python 3 going to be, by the way? If Unladen Swallow gets implemented, it might give some motivation for the switch. -- To pos

Re: [sage-devel] Re: int floor division

2011-01-18 Thread Robert Bradshaw
On Tue, Jan 18, 2011 at 1:20 AM, Simon King wrote: > Hi pang! > > On 18 Jan., 09:52, pang wrote: >> That would be a greater confusion: we'd have the Sage layer, and >> underlying that you wouldn't have neither python 2 nor python 3, but a >> mixture. > > Or you could argue the other way around: C

[sage-devel] Re: int floor division

2011-01-18 Thread Simon King
Hi pang! On 18 Jan., 09:52, pang wrote: > That would be a greater confusion: we'd have the Sage layer, and > underlying that you wouldn't have neither python 2 nor python 3, but a > mixture. Or you could argue the other way around: Currently, we have the layer of Sage `Integer`s and the layer of

[sage-devel] Re: int floor division

2011-01-18 Thread pang
That would be a greater confusion: we'd have the Sage layer, and underlying that you wouldn't have neither python 2 nor python 3, but a mixture. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegr