#18096: Libsingular conversion of (signed?) int to sage might have a
muisunderstanding about bitlength
--------------------------+----------------------------
   Reporter:  nbruin      |            Owner:
       Type:  defect      |           Status:  new
   Priority:  major       |        Milestone:  sage-6.6
  Component:  interfaces  |         Keywords:
  Merged in:              |          Authors:
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+----------------------------
 Note (in singular)
 {{{
 > LIB "normal.lib";
 > ring r=0,(x,y,z),dp;
 > ideal i=(x-y)*(y-z)*(z-x);
 > genus(i);
 -2
 }}}
 whereas in sage:
 {{{
 sage: x,y,z = QQ['x,y,z'].gens()
 sage: C= Curve((x-y)*(y-z)*(z-x));
 sage: sage: import sage.libs.singular.function_factory
 sage: sage: sing_genus =
 sage.libs.singular.function_factory.ff.normal__lib.genus
 sage: I=C.defining_ideal()
 sage: sing_genus(I)
 4294967294
 }}}
 so somehow the -2 seems to be represented in libsingular as a 32-bit
 signed integer and gets interpreted by sage as (probably) a 64-bit signed
 integer. The relevant code lives in
 sage.lib.singular.function.pyx:951 (to_python):
 {{{
         elif rtyp == INT_CMD:
             return <long>to_convert.data
 }}}
 Oddly enough, most of libsingular seems to refer to such fields with a
 `(long)` cast as well, and I would expect that, since sage and libsingular
 are supposed to be compiled with compatible compilers, they would agree on
 what `long` means.

--
Ticket URL: <http://trac.sagemath.org/ticket/18096>
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