patchGNU Octave - Patches: patch #9062, java conversion of numeric types

 
 

patch #9062: java conversion of numeric types

Submitter:  Ernst Reissner <ernstreissner>
Submitted:  Thu 28 Jul 2016 08:42:08 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Invalid Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 07 Mar 2019 02:00:46 AM UTC, comment #1: 

I don't think we need to introduce another conversion flag, and there is no patch attached to this patch item. If you want to raise the issue for discussion, please don't use the patch tracker, start a thread on the Octave maintainers mailing list (https://lists.gnu.org/mailman/listinfo/octave-maintainers).

Mike Miller <mtmiller>
Group Member
Thu 28 Jul 2016 08:42:08 PM UTC, original submission:  

Matlab converts both unsigned and signed integer types
into according java-types.
As java integer types are always signed,
if the leading bit is set, conversion changes sign
which is most likely a failure.
Thus is is reasonable, to have some check.

I suggest a flag java_strict_num_conversion
like java_unsigned_autoconversion
to decide whether Matlab conversion is applied
or strict conversion.

If conversely java-types are converted into octave types,
Matlab distinguishes:
whereas arrays as int[] are converted into int32[],
atomic type int is converted into double scalar 'for convenience'
(for arrays strict conversion saves memory).

Still Matlab behavior is not in all cases reasonable:
long has 1 sign bit and 63 mantissa bits,
whereas double scalar has 1 sign bit 53 mantissa bits
and 10 exponent bits thus loosing 10 digits precision
only by sloppy java to matlab conversion.

I would like to use the flag java_strict_num_conversion
also to make strict conversion:
double to double scalar, float to float scalar,
long to int64, int to int32, short to int16 and byte to int8.

In contrast I would like to drop java_unsigned_autoconversion
as it seems useless to me. What about deprecation?

Ernst Reissner <ernstreissner>

 

(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 ernstreissner (Submitted the item)
  • -email is unavailable- added by ernstreissner
  •  

    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 logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-07 mtmiller StatusNone Invalid
        Open/ClosedOpen Closed
    2016-07-28 ernstreissner Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code