#4392: smallest_integer() is broken
---------------------------+------------------------------------------------
 Reporter:  cremona        |       Owner:  cremona           
     Type:  defect         |      Status:  new               
 Priority:  major          |   Milestone:  sage-3.2          
Component:  number theory  |    Keywords:  number field ideal
---------------------------+------------------------------------------------
 For number field ideals and fractional ideals, the smallest_integer()
 function is broken in 2 ways:
 {{{
 sage: K.<a>=QuadraticField(-5)
 sage: I=K.ideal(7)
 sage: I.smallest_integer()
 ERROR: An unexpected error occurred while tokenizing input
 The following traceback may be corrupted or invalid
 The error message is: ('EOF in multi-line statement', (237, 0))

 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)

 /home/masgaj/PLMS/<ipython console> in <module>()

 /local/jec/sage-3.2.alpha1/local/lib/python2.5/site-
 packages/sage/rings/number_field/number_field_ideal.pyc in
 smallest_integer(self)
     731                         bound /= p
     732                 self.smallest_integer = ZZ(bound)
 --> 733                 return self.__smallest_integer
     734             I,d = self.integral_split() ## self = I/d
     735             n = I.smallest_integer()    ## n/d in self

 AttributeError: 'NumberFieldFractionalIdeal' object has no attribute
 '_NumberFieldIdeal__smallest_integer'
 sage: I.smallest_integer
 1
 sage: I.smallest_integer()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/masgaj/PLMS/<ipython console> in <module>()

 TypeError: 'sage.rings.integer.Integer' object is not callable
 }}}
 First: in line 732 of number_field_ideal.py it has
 {{{self.smallest_integer}}} instead of {{{self.__smallest_integer}}}, so
 instead of caching the computed value we overwrite the function itself!

 Second:  the answer is wrong (as the example shows).

 I will try to fix this and post a ptach today (Bug Day 2008-10-30).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4392>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to