#17852: Small cleanup in rings.arith and rings.integer
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/17852                 |  61b94c202141bf164d87bae24912c687553b7869
   Dependencies:  #16878             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:61 rws]:
 > I'm not sure if `rings/arith.py:binomial` should do more than numerics
 because the console user will first see `functions/other.py:binomial` and
 use that. The programmer OTOH probably won't need other than numerics. So,
 your efforts in `rings/arith.py:binomial` regarding other rings looks
 wasted to me.

 In the new version, `arith.binomial` do less than before regarding other
 rings (especially the symbolic one). What do you mean by numerics:
 integers? rationals? reals? complex? algebraic numbers?

 > There is already #17489 removing function duplicity for `factorial` so
 this is something to think of.

 Removing `binomial` from arith is not an option. On top of #17852 we have
 {{{
 sage: from sage.rings.arith import binomial as arith_binomial
 sage: %timeit arith_binomial(10,4)
 100000 loops, best of 3: 1.87 µs per loop
 sage: %timeit binomial(10,4)
 10000 loops, best of 3: 47.3 µs per loop
 }}}
 The slowdown is less dramatic for factorial but still visible
 {{{
 sage: from sage.rings.arith import factorial as arith_factorial
 sage: %timeit arith_factorial(10)
 1000000 loops, best of 3: 474 ns per loop
 sage: %timeit factorial(10)
 1000000 loops, best of 3: 1.02 µs per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17852#comment:62>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to