[Scilab-users] Overflow convention for integer types

Samuel Gougeon sgougeon at free.fr
Fri Feb 23 15:50:44 CET 2018


Le 23/02/2018 à 14:06, Stéphane Mottelet a écrit :
> Le 23/02/2018 à 13:45, Stéphane Mottelet a écrit :
>> Hello,
>>
>> I would like to point out the conventions used by Scilab and Matlab 
>> when an integer number is subject to overflow:
>>
>> Scilab 6.0.1:
>>
>> --> uint8(255)+1
>>  ans  =
>>
>>   0
>>
>> Matlab R2017b
>>
>> >> uint8(255)+1
>>
>> ans =
>>
>>   uint8
>>
>>    255
>>
>> Do you see any reason in favor of one of each ?
>>
>> S.
>>
>>
> Maybe monotonicity, but it should be discussed anyway.

This has been already done here or/and on Bugzilla, quite extensively.

Anyway, it can't be changed without breaking completely Scilab and 
external modules.
It is the same for 1.2 * int8(3) that yields an int8 and not a double.

The fact that all these optimizations with a global impact were not 
discussed and decided
to prepare the 6.0.0 is indeed a HUGE pity.
There are many ways to kill a software. Breaking things with a global 
impact like this []+num again,
and next minor release again, and next minor release again on another 
point... is an excellent one.

So, sorry, but this kind of (re)discussion and changes must be done when 
targeting a major release
for which all things must be rewritten.
And decided and announced to all authors ASAP, not just 1 year before 
the release.

And since you put this on the table while the 6.0.1 is just released and 
we had not the chance
to read you here about that before looks rather strange to me.

Best regards
Samuel




More information about the users mailing list