#18430: Bug in is_hyperbolic
-------------------------------------+-------------------------------------
       Reporter:  pkoprowski         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.7
      Component:  quadratic forms    |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Malcolm Rupert     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/MRupert/bug_in_is_hyperbolic     |  abb9f998469824499d2ac1c26234363c6b6a2a72
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Can you replace
 {{{
 if p == "infinity":
     return self.is_definite()
 else:
     ...
 }}}
 by
 {{{
 if p == Infinity:
     return self.is_definite()

 ...
 }}}
 This means you don't need to indent the whole block for `p` a prime number
 and I also prefer the actual value `Infinity` (which needs to be imported
 from `sage.rings.infinity`) instead of the string `"infinity"`.

 I also don't understand why you use `-1` at one point and `"infinity"`
 somewhere else.

 And instead of writing
 {{{
 (-1)**(m*(m-1)/2)) ## Actually, this -1 is the Hilbert symbol (-1,-1)
 }}}
 why don't you actually write
 {{{
 hilbert_symbol(-1, -1, p)**(m*(m-1)/2))
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18430#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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to