bugGNU Octave - Bugs: bug #38956, wrong value casting characters...

 
 

bug #38956: wrong value casting characters > 127 to integer types

Submitter:  None
Submitted:  Fri 10 May 2013 03:30:18 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Dave Goel Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Apr 2014 09:29:49 PM UTC, comment #3: 

This is now fixed with the fix for bug #42054.

Mike Miller <mtmiller>
Group Member
Fri 21 Jun 2013 03:05:25 AM UTC, comment #2: 

Confirmed:


octave:1> double (char (226))
ans =  226
octave:2> single (char (226))
ans =  226
octave:3> uint32 (char (226))
ans = 0
octave:4> int32 (char (226))
ans = -30


Mike Miller <mtmiller>
Group Member
Fri 10 May 2013 03:37:33 AM UTC, comment #1: 

Just to make things clear, it appears that in matlab `char (226)` actually gives a character â (or so a matlab user claims), but in Octave and Linux, `char (226)` gives me nothing.

Carnë Draug <carandraug>
Group Member
Fri 10 May 2013 03:30:18 AM UTC, original submission:  

This happens for characters > 128.

octave:122> uint32(char(226))
ans = 0
octave:123> uint32(char(22))
ans = 22


(For comparison, replacing unit32 by double in the above ameliorates the situation.
I don't think this problme can be  "explained away" by ascii's limitation to 128, but I could be wrong. This is char, not ascii, and again, double works whereas uint32 doesn't.)

Thanks.
Dave ("deego")

P.S.: carandraug reports that the bug persists in the devel version.

Anonymous

 

(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 mtmiller (Posted a comment)
  • -email is unavailable- added by None (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-05 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-01-19 mtmiller CategoryNone Interpreter
        Item GroupNone Incorrect Result
        Release3.2.0 dev
        Operating SystemGNU/Linux Any
        Summaryuint32 doesn\'t correctly cast some characters. wrong value casting characters > 127 to integer types
    2013-06-21 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code