CodePudding user response:
Unsigned long I; I=0 and 1; Is the maximumCodePudding user response:
If direct use unsigned long to put n! Result, may not be very good to control overflow, also can, of course, the last n! If value is overflow, the possible ratio (n - 1)! The smallIn order to insurance, it is suggested that if use unsigned long to determine whether overflow, can consider to use unsigned long long memory n! The maximum value, and then with the unsigned long, if is greater than the maximum value, that is overflow,
For your reference ~
CodePudding user response:
All kinds of numerical maximum minimumhttps://en.cppreference.com/w/c/types/limits
CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html