Changes between Version 5 and Version 9 of Ticket #14685


Ignore:
Timestamp:
06/08/13 16:26:24 (8 years ago)
Author:
MatthieuDien
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14685 – Description

    v5 v9  
    1515The good result should be 3 and not 1 (the order of the series B = x^3^ is 3 not 1 )
    1616
    17 Here, a patch which fix that:
    18 
    19 {{{
    20 --- series_old.py       2013-06-08 13:48:40.490566975 +0200
    21 +++ series.py   2013-06-08 14:00:41.903399503 +0200
    22 @@ -624,17 +624,17 @@
    23              c = self._stream
    24              n = c.number_computed()
    25  
    26 +            while ao < n:
    27 +                if self._stream[ao] == 0:
    28 +                    self.aorder += 1
    29 +                    ao += 1
    30 +                else:
    31 +                    self.order = ao
    32 +                    break
    33  
    34 -            if ao == 0 and n > 0:
    35 -                while ao < n:
    36 -                    if self._stream[ao] == 0:
    37 -                        self.aorder += 1
    38 -                        ao += 1
    39 -                    else:
    40 -                        break
    41  
    42              #Try to recognize the zero series
    43 -            if ao == n:
    44 +            if ao == n and n > 0:
    45                  #For non-constant series, we cannot do anything
    46                  if not c.is_constant():
    47                      return
    48 @@ -642,11 +642,7 @@
    49                      self.aorder = inf
    50                      self.order  = inf
    51                      return
    52 -               
    53 -            if ao < n:
    54 -                self.order = ao
    55 -           
    56 -   
    57 +
    58          if hasattr(self, '_reference') and self._reference is not None:
    59              self._reference._copy(self)
    60 }}}
    6117The bug is that the aorder is computed one time and never updated. This is because the order was assigned the first time then the condition self.order != unk becomes false and the update never comes.
    6218
     
    7531What we expected.
    7632
    77 PS : Thanks you for the commment, I tried to answer it.
     33PS : Thanks you for the commments, I tried to answer them.
     34PS 2 : I modified the patch as you asked