#14888: Make FiniteField_pari_ffelt the default for generic finite fields
-------------------------------------+-------------------------------------
       Reporter:  pbruin             |        Owner:  cpernet
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-5.13
      Component:  finite rings       |   Resolution:
       Keywords:  FiniteField        |    Merged in:
  performance                        |    Reviewers:  Jean-Pierre Flori,
        Authors:  Peter Bruin        |  Jeroen Demeyer
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
   Dependencies:  #12142, #15124,    |     Stopgaps:
  #15125                             |
-------------------------------------+-------------------------------------

Comment (by pbruin):

 Replying to [comment:24 jdemeyer]:
 > I tracked down the problem to this line in
 `devel/sage/sage/libs/singular/singular.pyx`:
 > {{{
 > ret = ret + c
 > }}}
 > where ret is a `pari_ffelt` element equal to zero, `c` is the C `long`
 equal to 2. The result is 0, while it should be 2.
 I wondered about the same line yesterday evening when I was looking at the
 surrounding function, but thought that it hardly looked like something
 that could fail with some small probability.  Does this line always give
 the wrong result (and for some reason just isn't called most of the time)?

 I noticed that c is defined by `cdef int c` (i.e. C int, not Python int),
 but is later used as a long; is that something to be suspicious about?

 If not, then (since `c` is wrapped into a Python `int` before being added
 to `ret`) it must be the conversion from Python `int` to `pari_ffelt` that
 is causing the problem, but in that case it is strange that it only fails
 here.

--
Ticket URL: <http://trac.sagemath.org/ticket/14888#comment:26>
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/groups/opt_out.

Reply via email to