且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

算术运算导致溢出。河豚algorythm

更新时间:2023-11-10 16:16:40

VB通常对它的数据类型是不可原谅的。我怀疑使用a和b的函数S存在铸造问题。 a和b是带有十六进制值的ANDing的结果,随后可以在S中返回否定结果。您将S的结果添加到无符号整数,并且两者不兼容。



您可以(但不要抱它)通过将UI添加到您的十六进制值来解决此问题:





VB in general is unforgiving with it's data types. I suspect that there is a casting problem with the function S with a and b. a and b are results of ANDing with a hex value, and subsequently could return a negative result in S. You're adding the results of S to an unsigned integer, and the two aren't compatible.

You might (but don't hold me to it) resolve this by appending UI to your hex values like this:


x And &HFFUI