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

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

[Octave-bug-tracker] [bug #41461] cast to integer type incorrect


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #41461] cast to integer type incorrect
Date: Fri, 15 Jan 2016 23:51:17 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #9, bug #41461 (project octave):

Mike has raised the valid points that  char(int8(-128))  is invalid, while 
char(-128) == char(0).

I agree that giving an error for char(x) with x>255 is better than giving a
value different from Matlab's, but Octave currently gives char(256) ==
char(0), which is no better than Mike's suggestion.

I propose the following behaviour:
1. char (x) = char(0)  for x<0 for all (non-complex) numeric types.  Based on
Michael's experiment, I assume this is what Matlab does.
2. char (x) undefined for x > 255 for all numeric types.

Mike, would you be interested in modifying your patch to implement this, of
others approve, or have you moved on?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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