[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #9689] Bug fix in library function rat.m
From: |
Erich |
Subject: |
[Octave-patch-tracker] [patch #9689] Bug fix in library function rat.m |
Date: |
Thu, 6 Sep 2018 16:04:07 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0 |
URL:
<https://savannah.gnu.org/patch/?9689>
Summary: Bug fix in library function rat.m
Project: GNU Octave
Submitted by: dynamic
Submitted on: Thu 06 Sep 2018 08:04:04 PM UTC
Category: Core : new feature
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Hello,
the library function rat.m providing rational approximation has a somewhat
unfavorable behavior when calling it with the values
rat(0)
rat(inf)
rat(-inf)
In either case, I get a divsion by zero warning and the results are poor.
I added a zero check in line 73,
old version: idx = find (abs (y-n./d) >= tol);
patch version: idx = find (y!=0 & abs (y-n./d) >= tol);
With this correction, no error occurs, and the results are acceptable.
I suggest to provide the patch version with the next release.
Best regards,
Dynamic
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 06 Sep 2018 08:04:04 PM UTC Name: rat.m Size: 4KiB By: dynamic
rat.m patch version 20180906
<http://savannah.gnu.org/patch/download.php?file_id=44947>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/patch/?9689>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-patch-tracker] [patch #9689] Bug fix in library function rat.m,
Erich <=