C# Short Error: Negating the minimum value of a twos complement number is invalid

后端 未结 4 634
小蘑菇
小蘑菇 2020-12-11 00:58

I have been encountering this error for my project, which involves working with Digital Audio Signals.

So I have been getting the amplitude values and recently encou

4条回答
  •  情话喂你
    2020-12-11 01:41

    16 bit signed int (short) takes values between -32,768 and 32,767.

    Negating -32768, or getting the absolute value, is impossible to do inside a 16 bit signed integer. The value (32,768) is greater than the maximum possible positive value (32,767).

    I would not like to advise you how to solve the problem without knowing more details of the algorithms you are using.

提交回复
热议问题