j********r 发帖数: 453 | 1 rt, like atoi, or sum a large array, how to handle overflow? Thank you. | l*****a 发帖数: 14598 | 2 check before use it
【在 j********r 的大作中提到】 : rt, like atoi, or sum a large array, how to handle overflow? Thank you.
| j********r 发帖数: 453 | 3 we can check the first bit or check whether the value is negative, if
overflowed then, throw exception? what to do if using c, return invalid type
value, like -1?
thanks
【在 l*****a 的大作中提到】 : check before use it
| r****t 发帖数: 10904 | 4 read the libc implementation.
type
【在 j********r 的大作中提到】 : we can check the first bit or check whether the value is negative, if : overflowed then, throw exception? what to do if using c, return invalid type : value, like -1? : thanks
| y**********u 发帖数: 6366 | 5 C : add check
Java: throw Exception
【在 j********r 的大作中提到】 : rt, like atoi, or sum a large array, how to handle overflow? Thank you.
|
|