bugGNU Octave - Bugs: bug #44855, isindex(): a string is an index?

 
 

bug #44855: isindex(): a string is an index?

Submitted by:  Martin Kunz <mkunz>
Submitted on:  Thu 16 Apr 2015 01:47:57 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.0.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 02 Jun 2015 04:47:02 PM UTC, comment #3:

Retagging release from 4.0.0-rc3 to 4.0.0.

John W. Eaton <jwe>
Project Administrator
Sat 18 Apr 2015 05:08:14 AM UTC, comment #2:

Thank you rik for the quick fix, these additional lines in the documentation are helpful!

Martin Kunz <mkunz>
Fri 17 Apr 2015 04:10:12 PM UTC, comment #1:

This is intended behavior. As you already found, a string is converted to type double when used as an index. I added some more text to the documentation for isindex which points this out (http://hg.savannah.gnu.org/hgweb/octave/rev/4d0c7fec0a31).

Marking bug fixed and closing report.

Rik <rik5>
Project Administrator
Thu 16 Apr 2015 01:47:57 PM UTC, original submission:

Hi,

I just noticed that

returns 1, which seems to be in line with what the interpreter does:

This is counterintuitive, but maybe intended. However, the documentation for isindex states "Valid indices are either positive integers (although possibly of real data type), or logical arrays", which to my mind does not include strings, so the output of the first example is not what I would expect.

Martin Kunz <mkunz>

 

(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 jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mkunz (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Jun 2015 04:47:02 PM UTCjweRelease4.0.0-rc3=>4.0.0
    Fri 17 Apr 2015 04:10:12 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1