Closed PerthCharles closed 10 years ago
Given n equals to -2147483648, it will overflow if using power(x, -n) directly. It's odd that the the previous version can be Accepted.
这个代码现在依然可以AC啊。你的这个建议很好,不过在64位机器上不会溢出,所以我估计leetcode还是可以AC的。
由于这题主要是考察分治法,我就不采纳你这个改动了。因为你这个修改,会让代码可读性下降。
Given n equals to -2147483648, it will overflow if using power(x, -n) directly. It's odd that the the previous version can be Accepted.