bitcmp() needs to be upgraded for Scilab 6
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
bitcmp() is the last remaining bitwise function to be upgraded for Scilab 6. Indeed,
bitcmp() has several pitfalls and limitations:
a) Positive signed encoded integers are not supported.
b) uint64 and int64 inttypes introduced in Scilab 6 are still not supported.
c) decimal numbers: bits indices pos are limited to 52 instead of log2(number_properties("huge")) == 1024
a)
--> bitcmp(uint8(7))
ans =
248
--> bitcmp(int8(7))
at line 41 of function bitcmp ( SCI\modules\elementary_functions\macros\bitcmp.sci line 54 )
bitcmp: Wrong input argument #1: Scalar/matrix of unsigned integers expected.
b)
--> bitcmp(uint64(7))
at line 69 of function bitcmp ( SCI\modules\elementary_functions\macros\bitcmp.sci line 82 )
Undefined variable: nmax
c)
--> bitcmp(2^50,60)
at line 65 of function bitcmp ( SCI\modules\elementary_functions\macros\bitcmp.sci line 78 )
bitcmp: Wrong value for input argument #2: Must be between 1 and 52.
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
bitcmp(int8(7))
bitcmp(int16(7))
bitcmp(int32(7))
bitcmp(uint64(7))
bitcmp(int64(7))
bitcmp(2^50,60)
OTHER INFORMATION:
------------------
See also the bug 16131