Re: [sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread Jeroen Demeyer
On 2015-12-21 17:53, Volker Braun wrote: In any case, if you are serious about binary operations then the next question is going to be: why is ^ not bitwise xor like for Python ints. That's actually a different question since it involves the preparser. In Sage, the ^ operator is calling __pow_

Re: [sage-devel] Re: bug report using assume

2015-12-21 Thread Vincent Delecroix
With respect to http://sourceforge.net/p/maxima/bugs/3058/ seems to be fixed upstream (3 days ago)... On 16/12/15 15:19, Nils Bruin wrote: On Wednesday, December 16, 2015 at 9:41:03 AM UTC-8, Robert Dodier wrote: If you can make a bug report about it, it would be helpful. It might have bee

[sage-devel] Re: modulo operators (integers, rationals, real numbers)

2015-12-21 Thread Travis Scrimshaw
> > 1) the unique x' between [0,y) of the form x + ny (used when both x > and y are integers) > > since this is usually the standard section of the quotient R -> R / yR (at least for the rings I think about doing modulus operations on, which, admittedly, is a very small set). Also, I feel

[sage-devel] modulo operators (integers, rationals, real numbers)

2015-12-21 Thread Vincent Delecroix
Hello, While responding to this ask question http://ask.sagemath.org/question/31740/why-112321-and-111320 I discovered some inconsistencies with the modulo operators in Sage. We indeed have three coexisting definitions for x % y 1) the unique x' between [0,y) of the form x + ny (used when

[sage-devel] Re: Looking Forward to Contribute

2015-12-21 Thread Sébastien Labbé
1. Look at what other developpers has done recently: http://trac.sagemath.org/timeline 2. Consult open tickets sorted by components. Active bugs (1568 tickets), Need work (187 tickets), Need review (79 tickets), Open Beginner Tickets (25), Mathematically Wrong Answers (77 tickets), etc. : http:/

Re: [sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread Sébastien Labbé
I often use ~ to get the multiplicative inverse of an element: sage: m = matrix.random(QQ,3,3) sage: m [-1 -2 1] [ 0 2 2] [ 1 -1 1] sage: ~m [ -2/5 -1/10 3/5] [ -1/5 1/5 -1/5] [ 1/5 3/10 1/5] sage: G = SymmetricGroup(4) sage: g = G.an_element() sage: g (1,2,3,4) sage: ~g (1,4,3,2) s

Re: [sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread David Roe
On Mon, Dec 21, 2015 at 8:53 AM, Volker Braun wrote: > On Monday, December 21, 2015 at 5:43:29 PM UTC+1, John Cremona wrote: >> >> Of course it does but no mathematician would ever write that in notation >> as ~x. >> > > Its still a minor optimization (avoids coercion in 1/x), so I'm not so > sur

Re: [sage-devel] Re: Jupyter notebook by default?

2015-12-21 Thread John H Palmieri
On Sunday, December 20, 2015 at 8:16:44 PM UTC-8, Nils Bruin wrote: > > On Sunday, December 20, 2015 at 2:12:57 PM UTC-10, William wrote: >> >> It will be much easier for our users to actually *use* a converter if >> we delay changing the defaults until after such a converter is >> written. >>

Re: [sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread Volker Braun
On Monday, December 21, 2015 at 5:43:29 PM UTC+1, John Cremona wrote: > > Of course it does but no mathematician would ever write that in notation > as ~x. > Its still a minor optimization (avoids coercion in 1/x), so I'm not so sure that nobody ever used it. In any case, if you are serious ab

Re: [sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread John Cremona
On 21 December 2015 at 16:40, Volker Braun wrote: > Just to point out the obvious: In Mathematics, "inverting an integer" means > 1/x Of course it does but no mathematician would ever write that in notation as ~x. > > Though if you want to work with Python ints nothing is stopping you... > > sag

[sage-devel] Re: Inverting Integers gives different behaviour than in Python

2015-12-21 Thread Volker Braun
Just to point out the obvious: In Mathematics, "inverting an integer" means 1/x Though if you want to work with Python ints nothing is stopping you... sage: ~2r -3 sage: ~int(2) -3 sage: ~2 1/2 sage: ~ZZ(2) 1/2 On Monday, December 21, 2015 at 5:22:20 PM UTC+1, Mark Bell wrote: > > In Python for

Re: [sage-devel] Inverting Integers gives different behaviour than in Python

2015-12-21 Thread John Cremona
Excellent question. Since ~ is not mathematical notation for anything, outside logic perhaps, does anyone use it at all within Sage? And since all a=5 ~a does is call a.__invert__ which returns one / self, it seems quite a waste of space. Someone might like to add a print statement into that

[sage-devel] Inverting Integers gives different behaviour than in Python

2015-12-21 Thread Mark Bell
In Python for an integer x, its invert ~x is defined to be its two-complement and is given by -1-x. On the other hand, in Sage Integers (from sage.rings.integer.Integer) have their __invert__ defined to be 1 / self

Re: [sage-devel] Re: Jupyter notebook by default?

2015-12-21 Thread Jeroen Demeyer
On 2015-12-21 09:40, Volker Braun wrote: Interacts DO work. Its just Jupyter interacts and not SageNB interacts. I think that the SageNB @interact API is much better designed and more consistent than the Jupyter @interact API. Unfortunately, I am not able to convince upstream Jupyter (really: i

Re: [sage-devel] Re: Jupyter notebook by default?

2015-12-21 Thread Volker Braun
On Monday, December 21, 2015 at 5:16:44 AM UTC+1, Nils Bruin wrote: > > different notebook. We could possibly alleviate the problem of lack of > information by somehow guessing if this is the first time this user starts > up sage ipython notebook > Thats inconsistent UX, now you open different n