We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在判断是否overflow时,int值好像本身就不会超过max和min,所以判断a + b < MAX这种是不是并不能得到想要的效果? 其次,min应该是2^31,所以是-2147483648,不是-2147483647;
我的想法就是,比如ab>0且a > 0,根据a + b <= max,判断b是否符合b <= max - a...不知道这样是否可以
另外minus和divide也需要判断一下overflow吧
The text was updated successfully, but these errors were encountered:
改了一下,可以 review 一下看看有没有问题:80f5deb & dc44bdb @emergencyd
Sorry, something went wrong.
No branches or pull requests
在判断是否overflow时,int值好像本身就不会超过max和min,所以判断a + b < MAX这种是不是并不能得到想要的效果?
其次,min应该是2^31,所以是-2147483648,不是-2147483647;
我的想法就是,比如ab>0且a > 0,根据a + b <= max,判断b是否符合b <= max - a...不知道这样是否可以
另外minus和divide也需要判断一下overflow吧
The text was updated successfully, but these errors were encountered: