`dec2char` function returns wrong values
floesche opened this issue · 1 comments
floesche commented
The function returns wrong values, for example:
function call | returns | expected return | correct |
---|---|---|---|
dec2char(uint8(128), 2) |
[0 1] | [128 0] | ❌ |
dec2char(uint8(128), 1) |
[128] | [128] | ✅ |
dec2char(int16(5000), 2) |
[0 20] | [136 19] | ❌ |
dec2char(intmax('int32'), 4) |
[0 0 0 128] | [255 255 255 127] | ❌ |
dec2char(intmax('uint32'), 4) |
[0 0 0 255] | [255 255 255 255] | ❌ |
dec2char(intmax('uint32'), 5) |
[0 0 0 0 1] | [255 255 255 255 0] | ❌ |
dec2char(intmax('uint32')-10, 4) |
[0 0 0 255] | [245 255 255 255] | ❌ |
floesche commented
Is the new function too slow? Make a speed comparison