8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
在判断是否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吧