bugGNU Octave - Bugs: bug #43369, rats has some internal overflow

 
 

bug #43369: rats has some internal overflow

Submitted by:  Colin Macdonald <cbm>
Submitted on:  Mon 06 Oct 2014 11:08:35 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Andreas Weber <andy1978>
Originator Name: Open/Closed: Closed
Release: 3.8.2Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 27 Nov 2014 08:10:52 PM UTC, comment #6:

I've pushed a cset c490eac28bbb to stable which fixes the overflow. I'll close this bugreport as fixed and open a new report which addresses the remaining matlab incompatibility for rats strlen.

Andreas Weber <andy1978>
Project MemberIn charge of this item.
Fri 21 Nov 2014 08:49:03 AM UTC, comment #5:

Pong! It's not as simple as I first thought it would be. As I see now, Matlabs rats behaves different regarding to "strlen". Their documentation on http://mathworks.com/help/matlab/ref/rats.html More About -> Algorithms says they calculate the tolerance dynamically. I'll ask on the mailinglist for some Matlab outputs.

Andreas Weber <andy1978>
Project MemberIn charge of this item.
Thu 20 Nov 2014 10:14:33 PM UTC, comment #4:

Ping! Andreas, I think you can go ahead and wrap your patch up with some comments into a changeset and commit it to the stable branch.

Rik <rik5>
Project Administrator
Mon 27 Oct 2014 07:45:48 PM UTC, comment #3:

This seems like an important enough fix that it should be put on the stable branch.

Also, I tested the patch on the dev branch and it works just fine there.

Rik <rik5>
Project Administrator
Tue 07 Oct 2014 05:35:37 PM UTC, comment #2:

I've also had a look, is the attached patch okay and if yes, to which branch should it go?

(file #32238)

Andreas Weber <andy1978>
Project MemberIn charge of this item.
Tue 07 Oct 2014 03:06:18 PM UTC, comment #1:

The trouble is this line in libinterp/corefcn/pr-output.cc:rational_approx at about line 404. The loop stopping criteria above this statement should be checking that the numerator (n) and the denominator (d) have not exceeded std::numeric_limits<int>::max ()).

Rik <rik5>
Project Administrator
Mon 06 Oct 2014 11:08:35 PM UTC, original submission:

Consider:

Matlab seems ok. "rats(pi, N)" seems to max out at "80143857/25510582" (with error 2*eps) at around N=30 but still produces that string with additional padding for N=1000.

Colin Macdonald <cbm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32238:  pr-output.cc.diff added by andy1978 (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by andy1978 (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by cbm (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 27 Nov 2014 08:10:52 PM UTCandy1978StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
      Releasedev=>3.8.2
    Mon 27 Oct 2014 07:45:48 PM UTCrik5StatusConfirmed=>In Progress
      Assigned toNone=>andy1978
    Tue 07 Oct 2014 05:35:37 PM UTCandy1978Attached File-=>Added pr-output.cc.diff, #32238
    Tue 07 Oct 2014 03:06:18 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1