#20074: QQbar cleaning 2
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.1
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/20074                 |  362a67b966045c2a89192df890a73e87e8354f84
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 For this change:
 {{{#!diff
 @@ -7461,14 +7076,16 @@ class ANBinaryExpr(ANDescr):

              op = self._op

 -            if op == '+':
 +            if op is operator.add:
                  value = left_value + right_value
 -            if op == '-':
 +            elif op is operator.sub:
                  value = left_value - right_value
 -            if op == '*':
 +            elif op is operator.mul:
                  value = left_value * right_value
 -            if op == '/':
 +            elif op is operator.div:
                  value = left_value / right_value
 +            else:
 +                raise RuntimeError("op is {}".format(op))

              if gen.is_trivial():
                  return ANRational(value)
 }}}
 Is there a reason why you did not just do `value = op(left_value,
 right_value)`?

 Have you done any speed comparisons?

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

Reply via email to