#13256: abs floor ceil for quadratic number field
---------------------------------------------------------------------------+
       Reporter:  vdelecroix                                               |    
     Owner:  vdelecroix  
           Type:  enhancement                                              |    
    Status:  needs_review
       Priority:  major                                                    |    
 Milestone:  sage-5.10   
      Component:  number fields                                            |    
Resolution:              
       Keywords:  absolute value, floor, ceiling, number field, quadratic  |   
Work issues:              
Report Upstream:  N/A                                                      |    
 Reviewers:              
        Authors:  Vincent Delecroix                                        |    
 Merged in:              
   Dependencies:  #7160, #13213                                            |    
  Stopgaps:              
---------------------------------------------------------------------------+

Comment (by vdelecroix):

 Replying to [comment:2 kcrisman]:
 > Does the removal of
 > {{{
 > K.<a> = NumberField(x^2+1, embedding=CDF.gen())
 > }}}
 > as an example mean that one couldn't use this syntax at all any more?

 This syntax is still available. The patch only aims to implement methods
 abs, floor and ceil for quadratic elements. As an example
 {{{
 sage: K.<sqrt2> = QuadraticField(2)
 sage: sqrt2.floor()
 1
 }}}
 It is yet possible (without the patch) to do
 {{{
 sage: K.<sqrt2> = QuadraticField(2)
 sage: floor(sqrt2)
 1
 }}}
 But there is a simpler and faster way to do it compared to what floor does
 (using the real interval field with finer and finer approximations). Note
 that if the method .floor is present, the the function floor will use it!


 > Would number fields from quadratics not automatically be quadratic
 fields (when mathematically appropriate, I'm excluding `x^2-1` and the
 like) and inherit these methods, or would that simply not work now?

 Yes, it is the way it is
 {{{
 sage: type(NumberField(x^2 + 1, 'a'))
 <class
 'sage.rings.number_field.number_field.NumberField_quadratic_with_category'>
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13256#comment:3>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to