bugGNU Octave - Bugs: bug #61411, char array input for isfinite()

 
 

bug #61411: char array input for isfinite()

Submitter:  Guillaume <gyom>
Submitted:  Mon 01 Nov 2021 03:25:24 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  WTF, Matlab?!?
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Nov 2021 06:20:03 PM UTC, comment #2: 

Thanks, I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/68aa1e839578

Closing report as fixed.

John W. Eaton <jwe>
Group administrator
Tue 02 Nov 2021 02:01:15 PM UTC, comment #1: 

If I'm correct, compatibility can be achieved with this change:


diff -r 313da8fd4657 libinterp/octave-value/ov-ch-mat.cc
--- a/libinterp/octave-value/ov-ch-mat.cc       Mon Nov 01 18:22:20 2021 +0100
+++ b/libinterp/octave-value/ov-ch-mat.cc       Tue Nov 02 13:59:36 2021 +0000
@@ -345,6 +345,7 @@
     case umap_fix:
     case umap_floor:
     case umap_imag:
+    case umap_isfinite:
     case umap_isinf:
     case umap_isnan:
     case umap_real:


Guillaume <gyom>
Mon 01 Nov 2021 03:25:24 PM UTC, original submission:  

Apparently isfinite() in Matlab accepts a char array input:


>> isfinite('abc')
ans =
  1x3 logical array
   1   1   1


while Octave expects a numeric array:


octave> isfinite('abc')
error: isfinite: argument must be numeric


Matlab documentation says that the input has to be an array and a char array is indeed one.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-10 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code