Re: [sage-support] Re: factorial

2020-11-30 Thread Samuel Lelièvre
Le lun. 30 nov. 2020 à 13:37, Dima Pasechnik a écrit : > > On Mon, Nov 30, 2020 at 9:16 AM Vincent Delecroix > <20100.delecr...@gmail.com> wrote: > > > > Le 30/11/2020 à 00:48, slelievre a écrit : > > > 2020-11-29 21:23:36 UTC, Guillermo: > > >> > > >> I wonder what would be wrong with replacing '

Re: [sage-support] Re: factorial

2020-11-30 Thread Dima Pasechnik
On Mon, Nov 30, 2020 at 9:16 AM Vincent Delecroix <20100.delecr...@gmail.com> wrote: > > Le 30/11/2020 à 00:48, slelievre a écrit : > > 2020-11-29 21:23:36 UTC, Guillermo: > >> > >> I wonder what would be wrong with replacing '!' → '.factorial()' > > > > Interesting idea. Just be careful with `!=`

Re: [sage-support] Re: factorial

2020-11-30 Thread Vincent Delecroix
Le 30/11/2020 à 00:48, slelievre a écrit : 2020-11-29 21:23:36 UTC, Guillermo: I wonder what would be wrong with replacing '!' → '.factorial()' Interesting idea. Just be careful with `!=` of course. Indeed the expression "3!=3" is ambiguous... Of course one can choose a priority (3!)=(3) o

Re: [sage-support] Re: factorial

2020-11-30 Thread Nils Bruin
On Sunday, November 29, 2020 at 1:23:36 PM UTC-8 list...@gmail.com wrote: > > I agree with you, but at the same time I wonder what would be wrong with > replacing > '!' → '.factorial()' > > Good observation: python already has postfix operators! I still don't like factorial notation; not even i

Re: [sage-support] Re: factorial

2020-11-29 Thread slelievre
2020-11-29 21:23:36 UTC, Guillermo: > > I wonder what would be wrong with replacing '!' → '.factorial()' Interesting idea. Just be careful with `!=` of course. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and s

Re: [sage-support] Re: factorial

2020-11-29 Thread G. M.-S.
Hi Nils. I agree with you, but at the same time I wonder what would be wrong with replacing '!' → '.factorial()' Best regards, Guillermo On Sun, 29 Nov 2020 at 22:02, Nils Bruin wrote: > With the current regexp-based rewriting we'd need a pattern of the kind > '!' -> 'factorial( are doing an

[sage-support] Re: factorial

2020-11-29 Thread Simon King
Hi Nils, fair enough. I didn't deeply think about it, my naive impression was that what the preparser does to R. = QQ[] is at least as complicated as dealing with the exclamation mark. But I guess you're right: It isn't. Best regards, Simon On 2020-11-29, Nils Bruin wrote: > With the current

[sage-support] Re: factorial

2020-11-29 Thread Nils Bruin
With the current regexp-based rewriting we'd need a pattern of the kind '!' -> 'factorial( '**" but that's very basic and doesn't need any context. To change an implicit unary postfix operator to an explicitly parenthesized prefix operator need almost complete parsing. Had the factorial been ex

[sage-support] Re: factorial

2020-11-29 Thread Simon King
On 2020-11-29, Simon King wrote: > Hi Emmanuel, > > On 2020-10-28, Emmanuel Charpentier wrote: >> Nope. This syntactic sugar is provided by `Maxima`'s and `Mathematica`'s >> readers, but not by Sage preparser. > > Would it be nice (and easy) to have in Sage? What prevents the preparser > from un

[sage-support] Re: factorial

2020-11-29 Thread Simon King
Hi Emmanuel, On 2020-10-28, Emmanuel Charpentier wrote: > Nope. This syntactic sugar is provided by `Maxima`'s and `Mathematica`'s > readers, but not by Sage preparser. Would it be nice (and easy) to have in Sage? What prevents the preparser from understanding "!"? Best regards, Simon -- You

[sage-support] Re: factorial

2020-10-28 Thread Emmanuel Charpentier
Nope. This syntactic sugar is provided by `Maxima`'s and `Mathematica`'s readers, but not by Sage preparser. BTW, I'd write `gamma(3/2)` rather than `factorial(/2)`... Le mercredi 28 octobre 2020 à 09:56:24 UTC+1, HG a écrit : > Hi, > > I would like to know if it is possible to use ! instead fa

[sage-support] Re: Factorial Carry Value in Python

2013-11-13 Thread Juan Grados
0<= u_i <= l-i 2013/11/13 Juan Grados > Let be s between 1 and l!-1 an integer value then s can expressed uniquely > than: > > s = u1*(l-1)! + u2*(l-2)!+ ... ul*0 > > Is there any function to find the values u1, u2, ..., ul in SAGE or python? > > -- > ---