Arithmetic operation resulted in an overflow. (Adding integers)

前端 未结 8 1692
既然无缘
既然无缘 2020-12-20 11:16

I can\'t understand this error:

In this call to method SetVolume, Volume = 2055786000 and size = 93552000. Volume is an Integer pr

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 11:33

    int.MaxValue = 2147483647
    2055786000 + 93552000 = 2149338000 > int.MaxValue
    

    So you cannot store this number into an integer. You could use Int64 type which has a maximum value of 9,223,372,036,854,775,807.

提交回复
热议问题