How to handle overflows of int16

I get a vector of int16 from a VISA-instrument where the values have rolled over if to big, the vector has an offset that I want to subtract but then the values just becomes floored at - 32768.
The question comes down to how can I make int16(-2^15-1) = 32767 ?

 采纳的回答

Micke Malmström
Micke Malmström 2015-11-26
编辑:Micke Malmström 2015-11-26

0 个投票

Ok this it what I do: >> mod(-2^15-1+(+2^15),2^16)+(-2^15) ans = 32.7670e+003

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by