octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43367] rats overly eager to use asterisks


From: Colin Macdonald
Subject: [Octave-bug-tracker] [bug #43367] rats overly eager to use asterisks
Date: Mon, 06 Oct 2014 23:01:59 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

URL:
  <http://savannah.gnu.org/bugs/?43367>

                 Summary: rats overly eager to use asterisks
                 Project: GNU Octave
            Submitted by: cbm
            Submitted on: Mon 06 Oct 2014 11:01:59 PM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

Octave:

octave:24> rats([2.5 2.05 2.005 2.0005 2.00005 2.000005 pi], 5)
ans =     5/2  41/20      *      *      *      *   22/7


Matlab:

rats([2.5 2.05 2.005 2.0005 2.00005 2.000005 pi], 5)
ans =
  5/2    2     2     2     2     2   22/7 


I find Matlab rats more pleasant ;-)

I think the interpretation of the LEN parameter (5 in my examples) should be:
try to find a rational approximation that fits in this many characters and
return "*" otherwise.

For example, both Octave and Matlab will use "*" for "rats(pi, 3)".

None of this seems to be documented, but I will file a separate issue for
that.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43367>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]