#11155: abs(pi+I) = pi+I
--------------------------+-------------------------------------------------
   Reporter:  benreynwar  |          Owner:  burcin  
       Type:  defect      |         Status:  new     
   Priority:  critical    |      Milestone:  sage-5.0
  Component:  symbolics   |       Keywords:          
Work_issues:              |       Upstream:  N/A     
   Reviewer:              |         Author:          
     Merged:              |   Dependencies:          
--------------------------+-------------------------------------------------

Comment(by kcrisman):

 
[http://www.ginac.de/ginac.git?p=ginac.git;a=commitdiff;h=05b3a16973aad40a9c17ee0f0bd06b02ac4706ef;hp=4077d8b144e2e5f3db75cf95fbb590981b2eb8d4
 Here] is the diff.

 {{{
 #!diff
 diff --git a/check/exam_numeric.cpp b/check/exam_numeric.cpp
 index 715acff..d5ae27b 100644 (file)
 --- a/check/exam_numeric.cpp
 +++ b/check/exam_numeric.cpp
 @@ -68,6 +68,11 @@ static unsigned exam_numeric1()
                      << " erroneously not recognized as complex rational"
 << endl;
                 ++result;
         }
 +       if (test_crat.info(info_flags::nonnegative)) {
 +               clog << test_crat
 +                    << " erroneously recognized as non-negative number"
 << endl;
 +               ++result;
 +       }

         int i = numeric(1984).to_int();
         if (i-1984) {
 diff --git a/ginac/numeric.cpp b/ginac/numeric.cpp
 index f05763d..18725b2 100644 (file)
 --- a/ginac/numeric.cpp
 +++ b/ginac/numeric.cpp
 @@ -700,7 +700,7 @@ bool numeric::info(unsigned inf) const
                 case info_flags::negative:
                         return is_negative();
                 case info_flags::nonnegative:
 -                       return !is_negative();
 +                       return is_zero() || is_positive();
                 case info_flags::posint:
                         return is_pos_integer();
                 case info_flags::negint:
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11155#comment:5>
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 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