bugGNU Octave - Bugs: bug #46598, unable to get single eps when...

 
 

bug #46598: unable to get single eps when specifying class

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Thu 03 Dec 2015 01:04:40 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 04 Dec 2015 05:55:27 PM UTC, comment #3:

> As for this bug, what would follow the principle of least surprise? Would it be to remove functionality and adopt the Matlab API for this function? Would it be to remove the 'eps (..., CLASS)' functionality and just support 'eps (CLASS)'


Least surprise is subjective. I'd argue that in this case, it would be expect the user to specify X. At the moment, the problem arises because when the user calls "eps (M, N, K)", we do not know if M is the number of rows or the X argument. Since we can't make an educated guess we should not be assuming a default. Therefore I'd propose the following as the least surprise:

Carnë Draug <carandraug>
Project Member
Fri 04 Dec 2015 05:45:03 PM UTC, comment #2:

I hate Matlab's desire to keep changing the API of perfectly good functions, especially when there is so little to be gained.

The syntax

can in most circumstances be replaced by

It's even the same number of characters so you're not saving on any typing.

As for this bug, what would follow the principle of least surprise? Would it be to remove functionality and adopt the Matlab API for this function? Would it be to remove the 'eps (..., CLASS)' functionality and just support 'eps (CLASS)'

Rik <rik5>
Project Administrator
Thu 03 Dec 2015 04:03:57 PM UTC, comment #1:

Here's what Matlab is documented to do:

http://www.mathworks.com/help/matlab/ref/eps.html

Maybe we should just match this behavior and nothing more?

I think I chose to also allow dimensions to be specified so that the definition of eps would be consistent with Inf and NaN, but then I missed this ambiguity.

http://www.mathworks.com/help/matlab/ref/inf.html?searchHighlight=inf

Oh, hey, now I notice that they have added even more baggage to the Inf and NaN functions (the "like" parameter, for example) so we are not compatible there now either.

TMW sure does seem to have a love affair with the overloaded function definitions...

John W. Eaton <jwe>
Project Administrator
Thu 03 Dec 2015 01:04:40 PM UTC, original submission:

The eps function has the following interface:

However, it is not possible to use "eps (X, CLASS)" because it thinks we are calling "eps (N, CLASS)"

Example:

So in order to actually get 'eps (5, "single")', one needs to do

I'm not sure if this should be a mistake of the documentation or if we should change the function to always require the X argument. Also, the documentation does not make it obvious that 'eps (CLASS)' is valid (but I can see how the ellipsis in 'eps (..., CLASS)' includes the just eps()).

Carnë Draug <carandraug>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by carandraug (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Dec 2015 05:45:03 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1