fork(1) download
  1.  
  2. #include <limits>
  3.  
  4. #include <iostream> // needed for demonstration purpose only
  5. #include <stdexcept> // needed for demonstration purpose only
  6. #include <array> // needed for demonstration purpose only
  7. #include <utility> // needed for demonstration purpose only
  8.  
  9. namespace safe
  10. {
  11. constexpr static auto max = std::numeric_limits<int>::max();
  12. constexpr static auto min = std::numeric_limits<int>::min();
  13.  
  14. int negation(int a);
  15.  
  16. int multiplication(int a, int b);
  17. int division(int a, int b);
  18. int addition(int a, int b);
  19. int subtraction(int a, int b);
  20. }
  21.  
  22. namespace test
  23. {
  24. template <typename Function>
  25. void unary(Function function, const char* function_name, int a);
  26.  
  27. template <typename Function>
  28. void binary(Function function, const char* function_name, int a, int b);
  29. }
  30.  
  31. int main()
  32. {
  33. using namespace safe;
  34. using UnaryFunction = int (*)(int);
  35. using BinaryFunction = int (*)(int, int);
  36. using FunctionName = const char*;
  37. using TestsUnary = std::array<std::pair<UnaryFunction, FunctionName>, 1>;
  38. using TestsBinary = std::array<std::pair<BinaryFunction, FunctionName>, 4>;
  39. TestsUnary unary_functions = {std::make_pair(negation, "negation")};
  40. TestsBinary binary_functions = {std::make_pair(multiplication, "multiplication"),
  41. std::make_pair(division, "division"),
  42. std::make_pair(addition, "addition"),
  43. std::make_pair(subtraction, "subtraction")};
  44.  
  45. std::array<int, 19> values = { min,
  46. (min / 2) - 1,
  47. min / 2,
  48. (min / 2) + 1,
  49. min / 3,
  50. -4,
  51. -3,
  52. -2,
  53. -1,
  54. 0,
  55. 1,
  56. 2,
  57. 3,
  58. 4,
  59. max / 3,
  60. (max / 2) - 1,
  61. max / 2,
  62. (max / 2) + 1,
  63. max};
  64.  
  65. using namespace test;
  66. for ( auto& testable : unary_functions )
  67. {
  68. auto& function = std::get<0>(testable);
  69. auto& name = std::get<1>(testable);
  70. for ( auto value : values )
  71. {
  72. test::unary(function, name, value);
  73. }
  74. }
  75.  
  76. for ( auto& testable : binary_functions )
  77. {
  78. auto& function = std::get<0>(testable);
  79. auto& name = std::get<1>(testable);
  80. for ( auto value1 : values )
  81. {
  82. for ( auto value2 : values )
  83. {
  84. test::binary(function, name, value1, value2);
  85. }
  86. }
  87. }
  88. return 0;
  89. }
  90.  
  91. namespace safe
  92. {
  93.  
  94.  
  95. /**
  96. * Integer multiplication.
  97. *
  98. * Detailed logic:
  99. * if ( a == 0 || b == 0 )
  100. * {
  101.   * return 0;
  102. * }
  103. * else if ( a == -1 )
  104. * {
  105. * return negation(b);
  106. * }
  107. * else if ( b == -1 )
  108. * {
  109. * return negation(a);
  110. * }
  111. * else if ( a > 0 && b > 0 )
  112. * {
  113.   * const auto limit_result = max; // result will be positive
  114. * const auto limit_a = limit_result / b; // (limit_a + 1) * b > max, which is invalid.
  115. * if ( a > limit_a )
  116. * {
  117.   * // error
  118. * }
  119. * }
  120. * else if ( a < 0 && b < 0 )
  121. * {
  122.   * const auto limit_result = max; // result will be positive
  123. * const auto limit_a = limit_result / b; // (limit_a - 1) * b > max, which is invalid.
  124. * if ( a < limit_a )
  125. * {
  126. * // error
  127. * }
  128. * }
  129. * else if ( a > 0 && b < 0 )
  130. * {
  131.   * const auto limit_result = min; // result will be negative
  132. * const auto limit_a = limit_result / b; // (limit_a + 1) * b < min, which is invalid
  133. * if ( a > limit_a )
  134. * {
  135.   * // error
  136. * }
  137. * }
  138. * else if ( a < 0 && b > 0 )
  139. * {
  140. * const auto limit_result = min; // result will be negative
  141. * const auto limit_a = limit_result / b; // (limit_a - 1) * b < min, which is invalid
  142. * if ( a < limit_a )
  143. * {
  144. * // error
  145. * }
  146. * }
  147. * return a * b;
  148. *
  149. */
  150. int multiplication(int a, int b)
  151. {
  152. if ( (a == 0) || (b == 0) )
  153. {
  154. return 0;
  155. }
  156. if ( a == -1 )
  157. {
  158. return negation(b);
  159. }
  160. if ( b == -1 )
  161. {
  162. return negation(a);
  163. }
  164. const auto limit_result = ((a > 0) == (b > 0)) ? max : min;
  165. const auto limit_a = limit_result / b; // well defined, since b != 0, b != -1.
  166. if ( (0 < a && limit_a < a) || (0 > a && limit_a > a) )
  167. {
  168. throw std::invalid_argument("Multiplication overflow.");
  169. }
  170. return a * b;
  171. }
  172.  
  173. /**
  174. *
  175. * Integer division can only fail if the divisor is zero.
  176. * It can also fail, it the divisor is -1 (because then only the sign changes and the magnitude isn't guaranteed to fit.)
  177. */
  178. int division(int a, int b)
  179. {
  180. if ( b == 0 )
  181. {
  182. throw std::invalid_argument("Division by zero.");
  183. }
  184. if ( b == -1 )
  185. {
  186. return negation(a);
  187. }
  188. return a / b; // division is safe, if divisor is not equal to zero.
  189. }
  190.  
  191. /**
  192. If the operands have different sign, the result cannot be invalid:
  193. w.l.o.g. a < 0 && b > 0
  194. min <= a < 0 < b <= max
  195. Hence,
  196. a >= min && b > 0, therefore a + b >= min + b >= min
  197. b <= max && a < 0, therefore b - (-a) <= max - (-a) <= max
  198. If the operands have the same sign, the result may be invalid.
  199. If a > 0 and b > 0:
  200. If a + b > max, then conversely a > max - b. max - b is valid.
  201. If a < 0 and b < 0:
  202. If a + b < min, then conversely a < min - b, min - b is valid.
  203. */
  204. int addition(int a, int b)
  205. {
  206. if ( (a > 0 && b > 0 && max - b < a) ||
  207. (a < 0 && b < 0 && a < min - b) )
  208. {
  209. throw std::invalid_argument("Addition overflow.");
  210. }
  211. return a + b;
  212. }
  213.  
  214. /**
  215. * Technically, this can be done by inverting b and calculating a + (-b).
  216. * This however can fail, if -b cannot be represented.
  217. *
  218. * Hence, the same logic as in addition is applied:
  219. * If a and b have the same sign, the result is valid.
  220. * If a > 0 and b < 0, the result may be too large, however, max + b is a valid number
  221. * If a < 0 and b > 0, the result may be too small, however, min + b is a valid number.
  222. */
  223. int subtraction(int a, int b)
  224. {
  225. if ( (a > 0 && b < 0 && max + b < a) ||
  226. (a < 0 && b > 0 && a < min + b) )
  227. {
  228. throw std::invalid_argument("Subtraction overflow.");
  229. }
  230. return a - b;
  231. }
  232.  
  233. /**
  234. -a is invalid, if it cannot be represented in that range.
  235. The integer type either has the range [-2^n, 2^n) or
  236. (-2^n, 2^n)
  237. That is, either the smallest number is -2^n or -2^n + 1,
  238. while the largest number is always 2^n - 1.
  239.  
  240. Hence, the only value that may not be valid input is the smallest number.
  241.  
  242. If the range is symmetric, every value can be inverted,
  243. otherwise, the negation fails for the smallest number.
  244. */
  245. int negation(int a)
  246. {
  247. constexpr static bool symmetric_range = (min + max == 0);
  248. if ( !symmetric_range && a == min )
  249. {
  250. throw std::invalid_argument("The integer representation doesn't allow negation of the smallest integer.");
  251. }
  252. return -a;
  253. }
  254. }
  255.  
  256. namespace test
  257. {
  258. template <typename Function>
  259. void unary(Function function, const char* function_name, int a)
  260. try
  261. {
  262. function(a);
  263. std::cout << function_name << '(' << a << ") succeeded\n";
  264. }
  265. catch ( ... )
  266. {
  267. std::cout << function_name << '(' << a << ") failed\n";
  268. }
  269.  
  270. template <typename Function>
  271. void binary(Function function, const char* function_name, int a, int b)
  272. try
  273. {
  274. function(a, b);
  275. std::cout << function_name << '(' << a << ", " << b << ") succeeded\n";
  276. }
  277. catch ( ... )
  278. {
  279. std::cout << function_name << '(' << a << ", " << b << ") failed\n";
  280. }
  281. }
  282.  
Success #stdin #stdout 0s 3276KB
stdin
Standard input is empty
stdout
negation(-2147483648) failed
negation(-1073741825) succeeded
negation(-1073741824) succeeded
negation(-1073741823) succeeded
negation(-715827882) succeeded
negation(-4) succeeded
negation(-3) succeeded
negation(-2) succeeded
negation(-1) succeeded
negation(0) succeeded
negation(1) succeeded
negation(2) succeeded
negation(3) succeeded
negation(4) succeeded
negation(715827882) succeeded
negation(1073741822) succeeded
negation(1073741823) succeeded
negation(1073741824) succeeded
negation(2147483647) succeeded
multiplication(-2147483648, -2147483648) failed
multiplication(-2147483648, -1073741825) failed
multiplication(-2147483648, -1073741824) failed
multiplication(-2147483648, -1073741823) failed
multiplication(-2147483648, -715827882) failed
multiplication(-2147483648, -4) failed
multiplication(-2147483648, -3) failed
multiplication(-2147483648, -2) failed
multiplication(-2147483648, -1) failed
multiplication(-2147483648, 0) succeeded
multiplication(-2147483648, 1) succeeded
multiplication(-2147483648, 2) failed
multiplication(-2147483648, 3) failed
multiplication(-2147483648, 4) failed
multiplication(-2147483648, 715827882) failed
multiplication(-2147483648, 1073741822) failed
multiplication(-2147483648, 1073741823) failed
multiplication(-2147483648, 1073741824) failed
multiplication(-2147483648, 2147483647) failed
multiplication(-1073741825, -2147483648) failed
multiplication(-1073741825, -1073741825) failed
multiplication(-1073741825, -1073741824) failed
multiplication(-1073741825, -1073741823) failed
multiplication(-1073741825, -715827882) failed
multiplication(-1073741825, -4) failed
multiplication(-1073741825, -3) failed
multiplication(-1073741825, -2) failed
multiplication(-1073741825, -1) succeeded
multiplication(-1073741825, 0) succeeded
multiplication(-1073741825, 1) succeeded
multiplication(-1073741825, 2) failed
multiplication(-1073741825, 3) failed
multiplication(-1073741825, 4) failed
multiplication(-1073741825, 715827882) failed
multiplication(-1073741825, 1073741822) failed
multiplication(-1073741825, 1073741823) failed
multiplication(-1073741825, 1073741824) failed
multiplication(-1073741825, 2147483647) failed
multiplication(-1073741824, -2147483648) failed
multiplication(-1073741824, -1073741825) failed
multiplication(-1073741824, -1073741824) failed
multiplication(-1073741824, -1073741823) failed
multiplication(-1073741824, -715827882) failed
multiplication(-1073741824, -4) failed
multiplication(-1073741824, -3) failed
multiplication(-1073741824, -2) failed
multiplication(-1073741824, -1) succeeded
multiplication(-1073741824, 0) succeeded
multiplication(-1073741824, 1) succeeded
multiplication(-1073741824, 2) succeeded
multiplication(-1073741824, 3) failed
multiplication(-1073741824, 4) failed
multiplication(-1073741824, 715827882) failed
multiplication(-1073741824, 1073741822) failed
multiplication(-1073741824, 1073741823) failed
multiplication(-1073741824, 1073741824) failed
multiplication(-1073741824, 2147483647) failed
multiplication(-1073741823, -2147483648) failed
multiplication(-1073741823, -1073741825) failed
multiplication(-1073741823, -1073741824) failed
multiplication(-1073741823, -1073741823) failed
multiplication(-1073741823, -715827882) failed
multiplication(-1073741823, -4) failed
multiplication(-1073741823, -3) failed
multiplication(-1073741823, -2) succeeded
multiplication(-1073741823, -1) succeeded
multiplication(-1073741823, 0) succeeded
multiplication(-1073741823, 1) succeeded
multiplication(-1073741823, 2) succeeded
multiplication(-1073741823, 3) failed
multiplication(-1073741823, 4) failed
multiplication(-1073741823, 715827882) failed
multiplication(-1073741823, 1073741822) failed
multiplication(-1073741823, 1073741823) failed
multiplication(-1073741823, 1073741824) failed
multiplication(-1073741823, 2147483647) failed
multiplication(-715827882, -2147483648) failed
multiplication(-715827882, -1073741825) failed
multiplication(-715827882, -1073741824) failed
multiplication(-715827882, -1073741823) failed
multiplication(-715827882, -715827882) failed
multiplication(-715827882, -4) failed
multiplication(-715827882, -3) succeeded
multiplication(-715827882, -2) succeeded
multiplication(-715827882, -1) succeeded
multiplication(-715827882, 0) succeeded
multiplication(-715827882, 1) succeeded
multiplication(-715827882, 2) succeeded
multiplication(-715827882, 3) succeeded
multiplication(-715827882, 4) failed
multiplication(-715827882, 715827882) failed
multiplication(-715827882, 1073741822) failed
multiplication(-715827882, 1073741823) failed
multiplication(-715827882, 1073741824) failed
multiplication(-715827882, 2147483647) failed
multiplication(-4, -2147483648) failed
multiplication(-4, -1073741825) failed
multiplication(-4, -1073741824) failed
multiplication(-4, -1073741823) failed
multiplication(-4, -715827882) failed
multiplication(-4, -4) succeeded
multiplication(-4, -3) succeeded
multiplication(-4, -2) succeeded
multiplication(-4, -1) succeeded
multiplication(-4, 0) succeeded
multiplication(-4, 1) succeeded
multiplication(-4, 2) succeeded
multiplication(-4, 3) succeeded
multiplication(-4, 4) succeeded
multiplication(-4, 715827882) failed
multiplication(-4, 1073741822) failed
multiplication(-4, 1073741823) failed
multiplication(-4, 1073741824) failed
multiplication(-4, 2147483647) failed
multiplication(-3, -2147483648) failed
multiplication(-3, -1073741825) failed
multiplication(-3, -1073741824) failed
multiplication(-3, -1073741823) failed
multiplication(-3, -715827882) succeeded
multiplication(-3, -4) succeeded
multiplication(-3, -3) succeeded
multiplication(-3, -2) succeeded
multiplication(-3, -1) succeeded
multiplication(-3, 0) succeeded
multiplication(-3, 1) succeeded
multiplication(-3, 2) succeeded
multiplication(-3, 3) succeeded
multiplication(-3, 4) succeeded
multiplication(-3, 715827882) succeeded
multiplication(-3, 1073741822) failed
multiplication(-3, 1073741823) failed
multiplication(-3, 1073741824) failed
multiplication(-3, 2147483647) failed
multiplication(-2, -2147483648) failed
multiplication(-2, -1073741825) failed
multiplication(-2, -1073741824) failed
multiplication(-2, -1073741823) succeeded
multiplication(-2, -715827882) succeeded
multiplication(-2, -4) succeeded
multiplication(-2, -3) succeeded
multiplication(-2, -2) succeeded
multiplication(-2, -1) succeeded
multiplication(-2, 0) succeeded
multiplication(-2, 1) succeeded
multiplication(-2, 2) succeeded
multiplication(-2, 3) succeeded
multiplication(-2, 4) succeeded
multiplication(-2, 715827882) succeeded
multiplication(-2, 1073741822) succeeded
multiplication(-2, 1073741823) succeeded
multiplication(-2, 1073741824) succeeded
multiplication(-2, 2147483647) failed
multiplication(-1, -2147483648) failed
multiplication(-1, -1073741825) succeeded
multiplication(-1, -1073741824) succeeded
multiplication(-1, -1073741823) succeeded
multiplication(-1, -715827882) succeeded
multiplication(-1, -4) succeeded
multiplication(-1, -3) succeeded
multiplication(-1, -2) succeeded
multiplication(-1, -1) succeeded
multiplication(-1, 0) succeeded
multiplication(-1, 1) succeeded
multiplication(-1, 2) succeeded
multiplication(-1, 3) succeeded
multiplication(-1, 4) succeeded
multiplication(-1, 715827882) succeeded
multiplication(-1, 1073741822) succeeded
multiplication(-1, 1073741823) succeeded
multiplication(-1, 1073741824) succeeded
multiplication(-1, 2147483647) succeeded
multiplication(0, -2147483648) succeeded
multiplication(0, -1073741825) succeeded
multiplication(0, -1073741824) succeeded
multiplication(0, -1073741823) succeeded
multiplication(0, -715827882) succeeded
multiplication(0, -4) succeeded
multiplication(0, -3) succeeded
multiplication(0, -2) succeeded
multiplication(0, -1) succeeded
multiplication(0, 0) succeeded
multiplication(0, 1) succeeded
multiplication(0, 2) succeeded
multiplication(0, 3) succeeded
multiplication(0, 4) succeeded
multiplication(0, 715827882) succeeded
multiplication(0, 1073741822) succeeded
multiplication(0, 1073741823) succeeded
multiplication(0, 1073741824) succeeded
multiplication(0, 2147483647) succeeded
multiplication(1, -2147483648) succeeded
multiplication(1, -1073741825) succeeded
multiplication(1, -1073741824) succeeded
multiplication(1, -1073741823) succeeded
multiplication(1, -715827882) succeeded
multiplication(1, -4) succeeded
multiplication(1, -3) succeeded
multiplication(1, -2) succeeded
multiplication(1, -1) succeeded
multiplication(1, 0) succeeded
multiplication(1, 1) succeeded
multiplication(1, 2) succeeded
multiplication(1, 3) succeeded
multiplication(1, 4) succeeded
multiplication(1, 715827882) succeeded
multiplication(1, 1073741822) succeeded
multiplication(1, 1073741823) succeeded
multiplication(1, 1073741824) succeeded
multiplication(1, 2147483647) succeeded
multiplication(2, -2147483648) failed
multiplication(2, -1073741825) failed
multiplication(2, -1073741824) succeeded
multiplication(2, -1073741823) succeeded
multiplication(2, -715827882) succeeded
multiplication(2, -4) succeeded
multiplication(2, -3) succeeded
multiplication(2, -2) succeeded
multiplication(2, -1) succeeded
multiplication(2, 0) succeeded
multiplication(2, 1) succeeded
multiplication(2, 2) succeeded
multiplication(2, 3) succeeded
multiplication(2, 4) succeeded
multiplication(2, 715827882) succeeded
multiplication(2, 1073741822) succeeded
multiplication(2, 1073741823) succeeded
multiplication(2, 1073741824) failed
multiplication(2, 2147483647) failed
multiplication(3, -2147483648) failed
multiplication(3, -1073741825) failed
multiplication(3, -1073741824) failed
multiplication(3, -1073741823) failed
multiplication(3, -715827882) succeeded
multiplication(3, -4) succeeded
multiplication(3, -3) succeeded
multiplication(3, -2) succeeded
multiplication(3, -1) succeeded
multiplication(3, 0) succeeded
multiplication(3, 1) succeeded
multiplication(3, 2) succeeded
multiplication(3, 3) succeeded
multiplication(3, 4) succeeded
multiplication(3, 715827882) succeeded
multiplication(3, 1073741822) failed
multiplication(3, 1073741823) failed
multiplication(3, 1073741824) failed
multiplication(3, 2147483647) failed
multiplication(4, -2147483648) failed
multiplication(4, -1073741825) failed
multiplication(4, -1073741824) failed
multiplication(4, -1073741823) failed
multiplication(4, -715827882) failed
multiplication(4, -4) succeeded
multiplication(4, -3) succeeded
multiplication(4, -2) succeeded
multiplication(4, -1) succeeded
multiplication(4, 0) succeeded
multiplication(4, 1) succeeded
multiplication(4, 2) succeeded
multiplication(4, 3) succeeded
multiplication(4, 4) succeeded
multiplication(4, 715827882) failed
multiplication(4, 1073741822) failed
multiplication(4, 1073741823) failed
multiplication(4, 1073741824) failed
multiplication(4, 2147483647) failed
multiplication(715827882, -2147483648) failed
multiplication(715827882, -1073741825) failed
multiplication(715827882, -1073741824) failed
multiplication(715827882, -1073741823) failed
multiplication(715827882, -715827882) failed
multiplication(715827882, -4) failed
multiplication(715827882, -3) succeeded
multiplication(715827882, -2) succeeded
multiplication(715827882, -1) succeeded
multiplication(715827882, 0) succeeded
multiplication(715827882, 1) succeeded
multiplication(715827882, 2) succeeded
multiplication(715827882, 3) succeeded
multiplication(715827882, 4) failed
multiplication(715827882, 715827882) failed
multiplication(715827882, 1073741822) failed
multiplication(715827882, 1073741823) failed
multiplication(715827882, 1073741824) failed
multiplication(715827882, 2147483647) failed
multiplication(1073741822, -2147483648) failed
multiplication(1073741822, -1073741825) failed
multiplication(1073741822, -1073741824) failed
multiplication(1073741822, -1073741823) failed
multiplication(1073741822, -715827882) failed
multiplication(1073741822, -4) failed
multiplication(1073741822, -3) failed
multiplication(1073741822, -2) succeeded
multiplication(1073741822, -1) succeeded
multiplication(1073741822, 0) succeeded
multiplication(1073741822, 1) succeeded
multiplication(1073741822, 2) succeeded
multiplication(1073741822, 3) failed
multiplication(1073741822, 4) failed
multiplication(1073741822, 715827882) failed
multiplication(1073741822, 1073741822) failed
multiplication(1073741822, 1073741823) failed
multiplication(1073741822, 1073741824) failed
multiplication(1073741822, 2147483647) failed
multiplication(1073741823, -2147483648) failed
multiplication(1073741823, -1073741825) failed
multiplication(1073741823, -1073741824) failed
multiplication(1073741823, -1073741823) failed
multiplication(1073741823, -715827882) failed
multiplication(1073741823, -4) failed
multiplication(1073741823, -3) failed
multiplication(1073741823, -2) succeeded
multiplication(1073741823, -1) succeeded
multiplication(1073741823, 0) succeeded
multiplication(1073741823, 1) succeeded
multiplication(1073741823, 2) succeeded
multiplication(1073741823, 3) failed
multiplication(1073741823, 4) failed
multiplication(1073741823, 715827882) failed
multiplication(1073741823, 1073741822) failed
multiplication(1073741823, 1073741823) failed
multiplication(1073741823, 1073741824) failed
multiplication(1073741823, 2147483647) failed
multiplication(1073741824, -2147483648) failed
multiplication(1073741824, -1073741825) failed
multiplication(1073741824, -1073741824) failed
multiplication(1073741824, -1073741823) failed
multiplication(1073741824, -715827882) failed
multiplication(1073741824, -4) failed
multiplication(1073741824, -3) failed
multiplication(1073741824, -2) succeeded
multiplication(1073741824, -1) succeeded
multiplication(1073741824, 0) succeeded
multiplication(1073741824, 1) succeeded
multiplication(1073741824, 2) failed
multiplication(1073741824, 3) failed
multiplication(1073741824, 4) failed
multiplication(1073741824, 715827882) failed
multiplication(1073741824, 1073741822) failed
multiplication(1073741824, 1073741823) failed
multiplication(1073741824, 1073741824) failed
multiplication(1073741824, 2147483647) failed
multiplication(2147483647, -2147483648) failed
multiplication(2147483647, -1073741825) failed
multiplication(2147483647, -1073741824) failed
multiplication(2147483647, -1073741823) failed
multiplication(2147483647, -715827882) failed
multiplication(2147483647, -4) failed
multiplication(2147483647, -3) failed
multiplication(2147483647, -2) failed
multiplication(2147483647, -1) succeeded
multiplication(2147483647, 0) succeeded
multiplication(2147483647, 1) succeeded
multiplication(2147483647, 2) failed
multiplication(2147483647, 3) failed
multiplication(2147483647, 4) failed
multiplication(2147483647, 715827882) failed
multiplication(2147483647, 1073741822) failed
multiplication(2147483647, 1073741823) failed
multiplication(2147483647, 1073741824) failed
multiplication(2147483647, 2147483647) failed
division(-2147483648, -2147483648) succeeded
division(-2147483648, -1073741825) succeeded
division(-2147483648, -1073741824) succeeded
division(-2147483648, -1073741823) succeeded
division(-2147483648, -715827882) succeeded
division(-2147483648, -4) succeeded
division(-2147483648, -3) succeeded
division(-2147483648, -2) succeeded
division(-2147483648, -1) failed
division(-2147483648, 0) failed
division(-2147483648, 1) succeeded
division(-2147483648, 2) succeeded
division(-2147483648, 3) succeeded
division(-2147483648, 4) succeeded
division(-2147483648, 715827882) succeeded
division(-2147483648, 1073741822) succeeded
division(-2147483648, 1073741823) succeeded
division(-2147483648, 1073741824) succeeded
division(-2147483648, 2147483647) succeeded
division(-1073741825, -2147483648) succeeded
division(-1073741825, -1073741825) succeeded
division(-1073741825, -1073741824) succeeded
division(-1073741825, -1073741823) succeeded
division(-1073741825, -715827882) succeeded
division(-1073741825, -4) succeeded
division(-1073741825, -3) succeeded
division(-1073741825, -2) succeeded
division(-1073741825, -1) succeeded
division(-1073741825, 0) failed
division(-1073741825, 1) succeeded
division(-1073741825, 2) succeeded
division(-1073741825, 3) succeeded
division(-1073741825, 4) succeeded
division(-1073741825, 715827882) succeeded
division(-1073741825, 1073741822) succeeded
division(-1073741825, 1073741823) succeeded
division(-1073741825, 1073741824) succeeded
division(-1073741825, 2147483647) succeeded
division(-1073741824, -2147483648) succeeded
division(-1073741824, -1073741825) succeeded
division(-1073741824, -1073741824) succeeded
division(-1073741824, -1073741823) succeeded
division(-1073741824, -715827882) succeeded
division(-1073741824, -4) succeeded
division(-1073741824, -3) succeeded
division(-1073741824, -2) succeeded
division(-1073741824, -1) succeeded
division(-1073741824, 0) failed
division(-1073741824, 1) succeeded
division(-1073741824, 2) succeeded
division(-1073741824, 3) succeeded
division(-1073741824, 4) succeeded
division(-1073741824, 715827882) succeeded
division(-1073741824, 1073741822) succeeded
division(-1073741824, 1073741823) succeeded
division(-1073741824, 1073741824) succeeded
division(-1073741824, 2147483647) succeeded
division(-1073741823, -2147483648) succeeded
division(-1073741823, -1073741825) succeeded
division(-1073741823, -1073741824) succeeded
division(-1073741823, -1073741823) succeeded
division(-1073741823, -715827882) succeeded
division(-1073741823, -4) succeeded
division(-1073741823, -3) succeeded
division(-1073741823, -2) succeeded
division(-1073741823, -1) succeeded
division(-1073741823, 0) failed
division(-1073741823, 1) succeeded
division(-1073741823, 2) succeeded
division(-1073741823, 3) succeeded
division(-1073741823, 4) succeeded
division(-1073741823, 715827882) succeeded
division(-1073741823, 1073741822) succeeded
division(-1073741823, 1073741823) succeeded
division(-1073741823, 1073741824) succeeded
division(-1073741823, 2147483647) succeeded
division(-715827882, -2147483648) succeeded
division(-715827882, -1073741825) succeeded
division(-715827882, -1073741824) succeeded
division(-715827882, -1073741823) succeeded
division(-715827882, -715827882) succeeded
division(-715827882, -4) succeeded
division(-715827882, -3) succeeded
division(-715827882, -2) succeeded
division(-715827882, -1) succeeded
division(-715827882, 0) failed
division(-715827882, 1) succeeded
division(-715827882, 2) succeeded
division(-715827882, 3) succeeded
division(-715827882, 4) succeeded
division(-715827882, 715827882) succeeded
division(-715827882, 1073741822) succeeded
division(-715827882, 1073741823) succeeded
division(-715827882, 1073741824) succeeded
division(-715827882, 2147483647) succeeded
division(-4, -2147483648) succeeded
division(-4, -1073741825) succeeded
division(-4, -1073741824) succeeded
division(-4, -1073741823) succeeded
division(-4, -715827882) succeeded
division(-4, -4) succeeded
division(-4, -3) succeeded
division(-4, -2) succeeded
division(-4, -1) succeeded
division(-4, 0) failed
division(-4, 1) succeeded
division(-4, 2) succeeded
division(-4, 3) succeeded
division(-4, 4) succeeded
division(-4, 715827882) succeeded
division(-4, 1073741822) succeeded
division(-4, 1073741823) succeeded
division(-4, 1073741824) succeeded
division(-4, 2147483647) succeeded
division(-3, -2147483648) succeeded
division(-3, -1073741825) succeeded
division(-3, -1073741824) succeeded
division(-3, -1073741823) succeeded
division(-3, -715827882) succeeded
division(-3, -4) succeeded
division(-3, -3) succeeded
division(-3, -2) succeeded
division(-3, -1) succeeded
division(-3, 0) failed
division(-3, 1) succeeded
division(-3, 2) succeeded
division(-3, 3) succeeded
division(-3, 4) succeeded
division(-3, 715827882) succeeded
division(-3, 1073741822) succeeded
division(-3, 1073741823) succeeded
division(-3, 1073741824) succeeded
division(-3, 2147483647) succeeded
division(-2, -2147483648) succeeded
division(-2, -1073741825) succeeded
division(-2, -1073741824) succeeded
division(-2, -1073741823) succeeded
division(-2, -715827882) succeeded
division(-2, -4) succeeded
division(-2, -3) succeeded
division(-2, -2) succeeded
division(-2, -1) succeeded
division(-2, 0) failed
division(-2, 1) succeeded
division(-2, 2) succeeded
division(-2, 3) succeeded
division(-2, 4) succeeded
division(-2, 715827882) succeeded
division(-2, 1073741822) succeeded
division(-2, 1073741823) succeeded
division(-2, 1073741824) succeeded
division(-2, 2147483647) succeeded
division(-1, -2147483648) succeeded
division(-1, -1073741825) succeeded
division(-1, -1073741824) succeeded
division(-1, -1073741823) succeeded
division(-1, -715827882) succeeded
division(-1, -4) succeeded
division(-1, -3) succeeded
division(-1, -2) succeeded
division(-1, -1) succeeded
division(-1, 0) failed
division(-1, 1) succeeded
division(-1, 2) succeeded
division(-1, 3) succeeded
division(-1, 4) succeeded
division(-1, 715827882) succeeded
division(-1, 1073741822) succeeded
division(-1, 1073741823) succeeded
division(-1, 1073741824) succeeded
division(-1, 2147483647) succeeded
division(0, -2147483648) succeeded
division(0, -1073741825) succeeded
division(0, -1073741824) succeeded
division(0, -1073741823) succeeded
division(0, -715827882) succeeded
division(0, -4) succeeded
division(0, -3) succeeded
division(0, -2) succeeded
division(0, -1) succeeded
division(0, 0) failed
division(0, 1) succeeded
division(0, 2) succeeded
division(0, 3) succeeded
division(0, 4) succeeded
division(0, 715827882) succeeded
division(0, 1073741822) succeeded
division(0, 1073741823) succeeded
division(0, 1073741824) succeeded
division(0, 2147483647) succeeded
division(1, -2147483648) succeeded
division(1, -1073741825) succeeded
division(1, -1073741824) succeeded
division(1, -1073741823) succeeded
division(1, -715827882) succeeded
division(1, -4) succeeded
division(1, -3) succeeded
division(1, -2) succeeded
division(1, -1) succeeded
division(1, 0) failed
division(1, 1) succeeded
division(1, 2) succeeded
division(1, 3) succeeded
division(1, 4) succeeded
division(1, 715827882) succeeded
division(1, 1073741822) succeeded
division(1, 1073741823) succeeded
division(1, 1073741824) succeeded
division(1, 2147483647) succeeded
division(2, -2147483648) succeeded
division(2, -1073741825) succeeded
division(2, -1073741824) succeeded
division(2, -1073741823) succeeded
division(2, -715827882) succeeded
division(2, -4) succeeded
division(2, -3) succeeded
division(2, -2) succeeded
division(2, -1) succeeded
division(2, 0) failed
division(2, 1) succeeded
division(2, 2) succeeded
division(2, 3) succeeded
division(2, 4) succeeded
division(2, 715827882) succeeded
division(2, 1073741822) succeeded
division(2, 1073741823) succeeded
division(2, 1073741824) succeeded
division(2, 2147483647) succeeded
division(3, -2147483648) succeeded
division(3, -1073741825) succeeded
division(3, -1073741824) succeeded
division(3, -1073741823) succeeded
division(3, -715827882) succeeded
division(3, -4) succeeded
division(3, -3) succeeded
division(3, -2) succeeded
division(3, -1) succeeded
division(3, 0) failed
division(3, 1) succeeded
division(3, 2) succeeded
division(3, 3) succeeded
division(3, 4) succeeded
division(3, 715827882) succeeded
division(3, 1073741822) succeeded
division(3, 1073741823) succeeded
division(3, 1073741824) succeeded
division(3, 2147483647) succeeded
division(4, -2147483648) succeeded
division(4, -1073741825) succeeded
division(4, -1073741824) succeeded
division(4, -1073741823) succeeded
division(4, -715827882) succeeded
division(4, -4) succeeded
division(4, -3) succeeded
division(4, -2) succeeded
division(4, -1) succeeded
division(4, 0) failed
division(4, 1) succeeded
division(4, 2) succeeded
division(4, 3) succeeded
division(4, 4) succeeded
division(4, 715827882) succeeded
division(4, 1073741822) succeeded
division(4, 1073741823) succeeded
division(4, 1073741824) succeeded
division(4, 2147483647) succeeded
division(715827882, -2147483648) succeeded
division(715827882, -1073741825) succeeded
division(715827882, -1073741824) succeeded
division(715827882, -1073741823) succeeded
division(715827882, -715827882) succeeded
division(715827882, -4) succeeded
division(715827882, -3) succeeded
division(715827882, -2) succeeded
division(715827882, -1) succeeded
division(715827882, 0) failed
division(715827882, 1) succeeded
division(715827882, 2) succeeded
division(715827882, 3) succeeded
division(715827882, 4) succeeded
division(715827882, 715827882) succeeded
division(715827882, 1073741822) succeeded
division(715827882, 1073741823) succeeded
division(715827882, 1073741824) succeeded
division(715827882, 2147483647) succeeded
division(1073741822, -2147483648) succeeded
division(1073741822, -1073741825) succeeded
division(1073741822, -1073741824) succeeded
division(1073741822, -1073741823) succeeded
division(1073741822, -715827882) succeeded
division(1073741822, -4) succeeded
division(1073741822, -3) succeeded
division(1073741822, -2) succeeded
division(1073741822, -1) succeeded
division(1073741822, 0) failed
division(1073741822, 1) succeeded
division(1073741822, 2) succeeded
division(1073741822, 3) succeeded
division(1073741822, 4) succeeded
division(1073741822, 715827882) succeeded
division(1073741822, 1073741822) succeeded
division(1073741822, 1073741823) succeeded
division(1073741822, 1073741824) succeeded
division(1073741822, 2147483647) succeeded
division(1073741823, -2147483648) succeeded
division(1073741823, -1073741825) succeeded
division(1073741823, -1073741824) succeeded
division(1073741823, -1073741823) succeeded
division(1073741823, -715827882) succeeded
division(1073741823, -4) succeeded
division(1073741823, -3) succeeded
division(1073741823, -2) succeeded
division(1073741823, -1) succeeded
division(1073741823, 0) failed
division(1073741823, 1) succeeded
division(1073741823, 2) succeeded
division(1073741823, 3) succeeded
division(1073741823, 4) succeeded
division(1073741823, 715827882) succeeded
division(1073741823, 1073741822) succeeded
division(1073741823, 1073741823) succeeded
division(1073741823, 1073741824) succeeded
division(1073741823, 2147483647) succeeded
division(1073741824, -2147483648) succeeded
division(1073741824, -1073741825) succeeded
division(1073741824, -1073741824) succeeded
division(1073741824, -1073741823) succeeded
division(1073741824, -715827882) succeeded
division(1073741824, -4) succeeded
division(1073741824, -3) succeeded
division(1073741824, -2) succeeded
division(1073741824, -1) succeeded
division(1073741824, 0) failed
division(1073741824, 1) succeeded
division(1073741824, 2) succeeded
division(1073741824, 3) succeeded
division(1073741824, 4) succeeded
division(1073741824, 715827882) succeeded
division(1073741824, 1073741822) succeeded
division(1073741824, 1073741823) succeeded
division(1073741824, 1073741824) succeeded
division(1073741824, 2147483647) succeeded
division(2147483647, -2147483648) succeeded
division(2147483647, -1073741825) succeeded
division(2147483647, -1073741824) succeeded
division(2147483647, -1073741823) succeeded
division(2147483647, -715827882) succeeded
division(2147483647, -4) succeeded
division(2147483647, -3) succeeded
division(2147483647, -2) succeeded
division(2147483647, -1) succeeded
division(2147483647, 0) failed
division(2147483647, 1) succeeded
division(2147483647, 2) succeeded
division(2147483647, 3) succeeded
division(2147483647, 4) succeeded
division(2147483647, 715827882) succeeded
division(2147483647, 1073741822) succeeded
division(2147483647, 1073741823) succeeded
division(2147483647, 1073741824) succeeded
division(2147483647, 2147483647) succeeded
addition(-2147483648, -2147483648) failed
addition(-2147483648, -1073741825) failed
addition(-2147483648, -1073741824) failed
addition(-2147483648, -1073741823) failed
addition(-2147483648, -715827882) failed
addition(-2147483648, -4) failed
addition(-2147483648, -3) failed
addition(-2147483648, -2) failed
addition(-2147483648, -1) failed
addition(-2147483648, 0) succeeded
addition(-2147483648, 1) succeeded
addition(-2147483648, 2) succeeded
addition(-2147483648, 3) succeeded
addition(-2147483648, 4) succeeded
addition(-2147483648, 715827882) succeeded
addition(-2147483648, 1073741822) succeeded
addition(-2147483648, 1073741823) succeeded
addition(-2147483648, 1073741824) succeeded
addition(-2147483648, 2147483647) succeeded
addition(-1073741825, -2147483648) failed
addition(-1073741825, -1073741825) failed
addition(-1073741825, -1073741824) failed
addition(-1073741825, -1073741823) succeeded
addition(-1073741825, -715827882) succeeded
addition(-1073741825, -4) succeeded
addition(-1073741825, -3) succeeded
addition(-1073741825, -2) succeeded
addition(-1073741825, -1) succeeded
addition(-1073741825, 0) succeeded
addition(-1073741825, 1) succeeded
addition(-1073741825, 2) succeeded
addition(-1073741825, 3) succeeded
addition(-1073741825, 4) succeeded
addition(-1073741825, 715827882) succeeded
addition(-1073741825, 1073741822) succeeded
addition(-1073741825, 1073741823) succeeded
addition(-1073741825, 1073741824) succeeded
addition(-1073741825, 2147483647) succeeded
addition(-1073741824, -2147483648) failed
addition(-1073741824, -1073741825) failed
addition(-1073741824, -1073741824) succeeded
addition(-1073741824, -1073741823) succeeded
addition(-1073741824, -715827882) succeeded
addition(-1073741824, -4) succeeded
addition(-1073741824, -3) succeeded
addition(-1073741824, -2) succeeded
addition(-1073741824, -1) succeeded
addition(-1073741824, 0) succeeded
addition(-1073741824, 1) succeeded
addition(-1073741824, 2) succeeded
addition(-1073741824, 3) succeeded
addition(-1073741824, 4) succeeded
addition(-1073741824, 715827882) succeeded
addition(-1073741824, 1073741822) succeeded
addition(-1073741824, 1073741823) succeeded
addition(-1073741824, 1073741824) succeeded
addition(-1073741824, 2147483647) succeeded
addition(-1073741823, -2147483648) failed
addition(-1073741823, -1073741825) succeeded
addition(-1073741823, -1073741824) succeeded
addition(-1073741823, -1073741823) succeeded
addition(-1073741823, -715827882) succeeded
addition(-1073741823, -4) succeeded
addition(-1073741823, -3) succeeded
addition(-1073741823, -2) succeeded
addition(-1073741823, -1) succeeded
addition(-1073741823, 0) succeeded
addition(-1073741823, 1) succeeded
addition(-1073741823, 2) succeeded
addition(-1073741823, 3) succeeded
addition(-1073741823, 4) succeeded
addition(-1073741823, 715827882) succeeded
addition(-1073741823, 1073741822) succeeded
addition(-1073741823, 1073741823) succeeded
addition(-1073741823, 1073741824) succeeded
addition(-1073741823, 2147483647) succeeded
addition(-715827882, -2147483648) failed
addition(-715827882, -1073741825) succeeded
addition(-715827882, -1073741824) succeeded
addition(-715827882, -1073741823) succeeded
addition(-715827882, -715827882) succeeded
addition(-715827882, -4) succeeded
addition(-715827882, -3) succeeded
addition(-715827882, -2) succeeded
addition(-715827882, -1) succeeded
addition(-715827882, 0) succeeded
addition(-715827882, 1) succeeded
addition(-715827882, 2) succeeded
addition(-715827882, 3) succeeded
addition(-715827882, 4) succeeded
addition(-715827882, 715827882) succeeded
addition(-715827882, 1073741822) succeeded
addition(-715827882, 1073741823) succeeded
addition(-715827882, 1073741824) succeeded
addition(-715827882, 2147483647) succeeded
addition(-4, -2147483648) failed
addition(-4, -1073741825) succeeded
addition(-4, -1073741824) succeeded
addition(-4, -1073741823) succeeded
addition(-4, -715827882) succeeded
addition(-4, -4) succeeded
addition(-4, -3) succeeded
addition(-4, -2) succeeded
addition(-4, -1) succeeded
addition(-4, 0) succeeded
addition(-4, 1) succeeded
addition(-4, 2) succeeded
addition(-4, 3) succeeded
addition(-4, 4) succeeded
addition(-4, 715827882) succeeded
addition(-4, 1073741822) succeeded
addition(-4, 1073741823) succeeded
addition(-4, 1073741824) succeeded
addition(-4, 2147483647) succeeded
addition(-3, -2147483648) failed
addition(-3, -1073741825) succeeded
addition(-3, -1073741824) succeeded
addition(-3, -1073741823) succeeded
addition(-3, -715827882) succeeded
addition(-3, -4) succeeded
addition(-3, -3) succeeded
addition(-3, -2) succeeded
addition(-3, -1) succeeded
addition(-3, 0) succeeded
addition(-3, 1) succeeded
addition(-3, 2) succeeded
addition(-3, 3) succeeded
addition(-3, 4) succeeded
addition(-3, 715827882) succeeded
addition(-3, 1073741822) succeeded
addition(-3, 1073741823) succeeded
addition(-3, 1073741824) succeeded
addition(-3, 2147483647) succeeded
addition(-2, -2147483648) failed
addition(-2, -1073741825) succeeded
addition(-2, -1073741824) succeeded
addition(-2, -1073741823) succeeded
addition(-2, -715827882) succeeded
addition(-2, -4) succeeded
addition(-2, -3) succeeded
addition(-2, -2) succeeded
addition(-2, -1) succeeded
addition(-2, 0) succeeded
addition(-2, 1) succeeded
addition(-2, 2) succeeded
addition(-2, 3) succeeded
addition(-2, 4) succeeded
addition(-2, 715827882) succeeded
addition(-2, 1073741822) succeeded
addition(-2, 1073741823) succeeded
addition(-2, 1073741824) succeeded
addition(-2, 2147483647) succeeded
addition(-1, -2147483648) failed
addition(-1, -1073741825) succeeded
addition(-1, -1073741824) succeeded
addition(-1, -1073741823) succeeded
addition(-1, -715827882) succeeded
addition(-1, -4) succeeded
addition(-1, -3) succeeded
addition(-1, -2) succeeded
addition(-1, -1) succeeded
addition(-1, 0) succeeded
addition(-1, 1) succeeded
addition(-1, 2) succeeded
addition(-1, 3) succeeded
addition(-1, 4) succeeded
addition(-1, 715827882) succeeded
addition(-1, 1073741822) succeeded
addition(-1, 1073741823) succeeded
addition(-1, 1073741824) succeeded
addition(-1, 2147483647) succeeded
addition(0, -2147483648) succeeded
addition(0, -1073741825) succeeded
addition(0, -1073741824) succeeded
addition(0, -1073741823) succeeded
addition(0, -715827882) succeeded
addition(0, -4) succeeded
addition(0, -3) succeeded
addition(0, -2) succeeded
addition(0, -1) succeeded
addition(0, 0) succeeded
addition(0, 1) succeeded
addition(0, 2) succeeded
addition(0, 3) succeeded
addition(0, 4) succeeded
addition(0, 715827882) succeeded
addition(0, 1073741822) succeeded
addition(0, 1073741823) succeeded
addition(0, 1073741824) succeeded
addition(0, 2147483647) succeeded
addition(1, -2147483648) succeeded
addition(1, -1073741825) succeeded
addition(1, -1073741824) succeeded
addition(1, -1073741823) succeeded
addition(1, -715827882) succeeded
addition(1, -4) succeeded
addition(1, -3) succeeded
addition(1, -2) succeeded
addition(1, -1) succeeded
addition(1, 0) succeeded
addition(1, 1) succeeded
addition(1, 2) succeeded
addition(1, 3) succeeded
addition(1, 4) succeeded
addition(1, 715827882) succeeded
addition(1, 1073741822) succeeded
addition(1, 1073741823) succeeded
addition(1, 1073741824) succeeded
addition(1, 2147483647) failed
addition(2, -2147483648) succeeded
addition(2, -1073741825) succeeded
addition(2, -1073741824) succeeded
addition(2, -1073741823) succeeded
addition(2, -715827882) succeeded
addition(2, -4) succeeded
addition(2, -3) succeeded
addition(2, -2) succeeded
addition(2, -1) succeeded
addition(2, 0) succeeded
addition(2, 1) succeeded
addition(2, 2) succeeded
addition(2, 3) succeeded
addition(2, 4) succeeded
addition(2, 715827882) succeeded
addition(2, 1073741822) succeeded
addition(2, 1073741823) succeeded
addition(2, 1073741824) succeeded
addition(2, 2147483647) failed
addition(3, -2147483648) succeeded
addition(3, -1073741825) succeeded
addition(3, -1073741824) succeeded
addition(3, -1073741823) succeeded
addition(3, -715827882) succeeded
addition(3, -4) succeeded
addition(3, -3) succeeded
addition(3, -2) succeeded
addition(3, -1) succeeded
addition(3, 0) succeeded
addition(3, 1) succeeded
addition(3, 2) succeeded
addition(3, 3) succeeded
addition(3, 4) succeeded
addition(3, 715827882) succeeded
addition(3, 1073741822) succeeded
addition(3, 1073741823) succeeded
addition(3, 1073741824) succeeded
addition(3, 2147483647) failed
addition(4, -2147483648) succeeded
addition(4, -1073741825) succeeded
addition(4, -1073741824) succeeded
addition(4, -1073741823) succeeded
addition(4, -715827882) succeeded
addition(4, -4) succeeded
addition(4, -3) succeeded
addition(4, -2) succeeded
addition(4, -1) succeeded
addition(4, 0) succeeded
addition(4, 1) succeeded
addition(4, 2) succeeded
addition(4, 3) succeeded
addition(4, 4) succeeded
addition(4, 715827882) succeeded
addition(4, 1073741822) succeeded
addition(4, 1073741823) succeeded
addition(4, 1073741824) succeeded
addition(4, 2147483647) failed
addition(715827882, -2147483648) succeeded
addition(715827882, -1073741825) succeeded
addition(715827882, -1073741824) succeeded
addition(715827882, -1073741823) succeeded
addition(715827882, -715827882) succeeded
addition(715827882, -4) succeeded
addition(715827882, -3) succeeded
addition(715827882, -2) succeeded
addition(715827882, -1) succeeded
addition(715827882, 0) succeeded
addition(715827882, 1) succeeded
addition(715827882, 2) succeeded
addition(715827882, 3) succeeded
addition(715827882, 4) succeeded
addition(715827882, 715827882) succeeded
addition(715827882, 1073741822) succeeded
addition(715827882, 1073741823) succeeded
addition(715827882, 1073741824) succeeded
addition(715827882, 2147483647) failed
addition(1073741822, -2147483648) succeeded
addition(1073741822, -1073741825) succeeded
addition(1073741822, -1073741824) succeeded
addition(1073741822, -1073741823) succeeded
addition(1073741822, -715827882) succeeded
addition(1073741822, -4) succeeded
addition(1073741822, -3) succeeded
addition(1073741822, -2) succeeded
addition(1073741822, -1) succeeded
addition(1073741822, 0) succeeded
addition(1073741822, 1) succeeded
addition(1073741822, 2) succeeded
addition(1073741822, 3) succeeded
addition(1073741822, 4) succeeded
addition(1073741822, 715827882) succeeded
addition(1073741822, 1073741822) succeeded
addition(1073741822, 1073741823) succeeded
addition(1073741822, 1073741824) succeeded
addition(1073741822, 2147483647) failed
addition(1073741823, -2147483648) succeeded
addition(1073741823, -1073741825) succeeded
addition(1073741823, -1073741824) succeeded
addition(1073741823, -1073741823) succeeded
addition(1073741823, -715827882) succeeded
addition(1073741823, -4) succeeded
addition(1073741823, -3) succeeded
addition(1073741823, -2) succeeded
addition(1073741823, -1) succeeded
addition(1073741823, 0) succeeded
addition(1073741823, 1) succeeded
addition(1073741823, 2) succeeded
addition(1073741823, 3) succeeded
addition(1073741823, 4) succeeded
addition(1073741823, 715827882) succeeded
addition(1073741823, 1073741822) succeeded
addition(1073741823, 1073741823) succeeded
addition(1073741823, 1073741824) succeeded
addition(1073741823, 2147483647) failed
addition(1073741824, -2147483648) succeeded
addition(1073741824, -1073741825) succeeded
addition(1073741824, -1073741824) succeeded
addition(1073741824, -1073741823) succeeded
addition(1073741824, -715827882) succeeded
addition(1073741824, -4) succeeded
addition(1073741824, -3) succeeded
addition(1073741824, -2) succeeded
addition(1073741824, -1) succeeded
addition(1073741824, 0) succeeded
addition(1073741824, 1) succeeded
addition(1073741824, 2) succeeded
addition(1073741824, 3) succeeded
addition(1073741824, 4) succeeded
addition(1073741824, 715827882) succeeded
addition(1073741824, 1073741822) succeeded
addition(1073741824, 1073741823) succeeded
addition(1073741824, 1073741824) failed
addition(1073741824, 2147483647) failed
addition(2147483647, -2147483648) succeeded
addition(2147483647, -1073741825) succeeded
addition(2147483647, -1073741824) succeeded
addition(2147483647, -1073741823) succeeded
addition(2147483647, -715827882) succeeded
addition(2147483647, -4) succeeded
addition(2147483647, -3) succeeded
addition(2147483647, -2) succeeded
addition(2147483647, -1) succeeded
addition(2147483647, 0) succeeded
addition(2147483647, 1) failed
addition(2147483647, 2) failed
addition(2147483647, 3) failed
addition(2147483647, 4) failed
addition(2147483647, 715827882) failed
addition(2147483647, 1073741822) failed
addition(2147483647, 1073741823) failed
addition(2147483647, 1073741824) failed
addition(2147483647, 2147483647) failed
subtraction(-2147483648, -2147483648) succeeded
subtraction(-2147483648, -1073741825) succeeded
subtraction(-2147483648, -1073741824) succeeded
subtraction(-2147483648, -1073741823) succeeded
subtraction(-2147483648, -715827882) succeeded
subtraction(-2147483648, -4) succeeded
subtraction(-2147483648, -3) succeeded
subtraction(-2147483648, -2) succeeded
subtraction(-2147483648, -1) succeeded
subtraction(-2147483648, 0) succeeded
subtraction(-2147483648, 1) failed
subtraction(-2147483648, 2) failed
subtraction(-2147483648, 3) failed
subtraction(-2147483648, 4) failed
subtraction(-2147483648, 715827882) failed
subtraction(-2147483648, 1073741822) failed
subtraction(-2147483648, 1073741823) failed
subtraction(-2147483648, 1073741824) failed
subtraction(-2147483648, 2147483647) failed
subtraction(-1073741825, -2147483648) succeeded
subtraction(-1073741825, -1073741825) succeeded
subtraction(-1073741825, -1073741824) succeeded
subtraction(-1073741825, -1073741823) succeeded
subtraction(-1073741825, -715827882) succeeded
subtraction(-1073741825, -4) succeeded
subtraction(-1073741825, -3) succeeded
subtraction(-1073741825, -2) succeeded
subtraction(-1073741825, -1) succeeded
subtraction(-1073741825, 0) succeeded
subtraction(-1073741825, 1) succeeded
subtraction(-1073741825, 2) succeeded
subtraction(-1073741825, 3) succeeded
subtraction(-1073741825, 4) succeeded
subtraction(-1073741825, 715827882) succeeded
subtraction(-1073741825, 1073741822) succeeded
subtraction(-1073741825, 1073741823) succeeded
subtraction(-1073741825, 1073741824) failed
subtraction(-1073741825, 2147483647) failed
subtraction(-1073741824, -2147483648) succeeded
subtraction(-1073741824, -1073741825) succeeded
subtraction(-1073741824, -1073741824) succeeded
subtraction(-1073741824, -1073741823) succeeded
subtraction(-1073741824, -715827882) succeeded
subtraction(-1073741824, -4) succeeded
subtraction(-1073741824, -3) succeeded
subtraction(-1073741824, -2) succeeded
subtraction(-1073741824, -1) succeeded
subtraction(-1073741824, 0) succeeded
subtraction(-1073741824, 1) succeeded
subtraction(-1073741824, 2) succeeded
subtraction(-1073741824, 3) succeeded
subtraction(-1073741824, 4) succeeded
subtraction(-1073741824, 715827882) succeeded
subtraction(-1073741824, 1073741822) succeeded
subtraction(-1073741824, 1073741823) succeeded
subtraction(-1073741824, 1073741824) succeeded
subtraction(-1073741824, 2147483647) failed
subtraction(-1073741823, -2147483648) succeeded
subtraction(-1073741823, -1073741825) succeeded
subtraction(-1073741823, -1073741824) succeeded
subtraction(-1073741823, -1073741823) succeeded
subtraction(-1073741823, -715827882) succeeded
subtraction(-1073741823, -4) succeeded
subtraction(-1073741823, -3) succeeded
subtraction(-1073741823, -2) succeeded
subtraction(-1073741823, -1) succeeded
subtraction(-1073741823, 0) succeeded
subtraction(-1073741823, 1) succeeded
subtraction(-1073741823, 2) succeeded
subtraction(-1073741823, 3) succeeded
subtraction(-1073741823, 4) succeeded
subtraction(-1073741823, 715827882) succeeded
subtraction(-1073741823, 1073741822) succeeded
subtraction(-1073741823, 1073741823) succeeded
subtraction(-1073741823, 1073741824) succeeded
subtraction(-1073741823, 2147483647) failed
subtraction(-715827882, -2147483648) succeeded
subtraction(-715827882, -1073741825) succeeded
subtraction(-715827882, -1073741824) succeeded
subtraction(-715827882, -1073741823) succeeded
subtraction(-715827882, -715827882) succeeded
subtraction(-715827882, -4) succeeded
subtraction(-715827882, -3) succeeded
subtraction(-715827882, -2) succeeded
subtraction(-715827882, -1) succeeded
subtraction(-715827882, 0) succeeded
subtraction(-715827882, 1) succeeded
subtraction(-715827882, 2) succeeded
subtraction(-715827882, 3) succeeded
subtraction(-715827882, 4) succeeded
subtraction(-715827882, 715827882) succeeded
subtraction(-715827882, 1073741822) succeeded
subtraction(-715827882, 1073741823) succeeded
subtraction(-715827882, 1073741824) succeeded
subtraction(-715827882, 2147483647) failed
subtraction(-4, -2147483648) succeeded
subtraction(-4, -1073741825) succeeded
subtraction(-4, -1073741824) succeeded
subtraction(-4, -1073741823) succeeded
subtraction(-4, -715827882) succeeded
subtraction(-4, -4) succeeded
subtraction(-4, -3) succeeded
subtraction(-4, -2) succeeded
subtraction(-4, -1) succeeded
subtraction(-4, 0) succeeded
subtraction(-4, 1) succeeded
subtraction(-4, 2) succeeded
subtraction(-4, 3) succeeded
subtraction(-4, 4) succeeded
subtraction(-4, 715827882) succeeded
subtraction(-4, 1073741822) succeeded
subtraction(-4, 1073741823) succeeded
subtraction(-4, 1073741824) succeeded
subtraction(-4, 2147483647) failed
subtraction(-3, -2147483648) succeeded
subtraction(-3, -1073741825) succeeded
subtraction(-3, -1073741824) succeeded
subtraction(-3, -1073741823) succeeded
subtraction(-3, -715827882) succeeded
subtraction(-3, -4) succeeded
subtraction(-3, -3) succeeded
subtraction(-3, -2) succeeded
subtraction(-3, -1) succeeded
subtraction(-3, 0) succeeded
subtraction(-3, 1) succeeded
subtraction(-3, 2) succeeded
subtraction(-3, 3) succeeded
subtraction(-3, 4) succeeded
subtraction(-3, 715827882) succeeded
subtraction(-3, 1073741822) succeeded
subtraction(-3, 1073741823) succeeded
subtraction(-3, 1073741824) succeeded
subtraction(-3, 2147483647) failed
subtraction(-2, -2147483648) succeeded
subtraction(-2, -1073741825) succeeded
subtraction(-2, -1073741824) succeeded
subtraction(-2, -1073741823) succeeded
subtraction(-2, -715827882) succeeded
subtraction(-2, -4) succeeded
subtraction(-2, -3) succeeded
subtraction(-2, -2) succeeded
subtraction(-2, -1) succeeded
subtraction(-2, 0) succeeded
subtraction(-2, 1) succeeded
subtraction(-2, 2) succeeded
subtraction(-2, 3) succeeded
subtraction(-2, 4) succeeded
subtraction(-2, 715827882) succeeded
subtraction(-2, 1073741822) succeeded
subtraction(-2, 1073741823) succeeded
subtraction(-2, 1073741824) succeeded
subtraction(-2, 2147483647) failed
subtraction(-1, -2147483648) succeeded
subtraction(-1, -1073741825) succeeded
subtraction(-1, -1073741824) succeeded
subtraction(-1, -1073741823) succeeded
subtraction(-1, -715827882) succeeded
subtraction(-1, -4) succeeded
subtraction(-1, -3) succeeded
subtraction(-1, -2) succeeded
subtraction(-1, -1) succeeded
subtraction(-1, 0) succeeded
subtraction(-1, 1) succeeded
subtraction(-1, 2) succeeded
subtraction(-1, 3) succeeded
subtraction(-1, 4) succeeded
subtraction(-1, 715827882) succeeded
subtraction(-1, 1073741822) succeeded
subtraction(-1, 1073741823) succeeded
subtraction(-1, 1073741824) succeeded
subtraction(-1, 2147483647) succeeded
subtraction(0, -2147483648) succeeded
subtraction(0, -1073741825) succeeded
subtraction(0, -1073741824) succeeded
subtraction(0, -1073741823) succeeded
subtraction(0, -715827882) succeeded
subtraction(0, -4) succeeded
subtraction(0, -3) succeeded
subtraction(0, -2) succeeded
subtraction(0, -1) succeeded
subtraction(0, 0) succeeded
subtraction(0, 1) succeeded
subtraction(0, 2) succeeded
subtraction(0, 3) succeeded
subtraction(0, 4) succeeded
subtraction(0, 715827882) succeeded
subtraction(0, 1073741822) succeeded
subtraction(0, 1073741823) succeeded
subtraction(0, 1073741824) succeeded
subtraction(0, 2147483647) succeeded
subtraction(1, -2147483648) failed
subtraction(1, -1073741825) succeeded
subtraction(1, -1073741824) succeeded
subtraction(1, -1073741823) succeeded
subtraction(1, -715827882) succeeded
subtraction(1, -4) succeeded
subtraction(1, -3) succeeded
subtraction(1, -2) succeeded
subtraction(1, -1) succeeded
subtraction(1, 0) succeeded
subtraction(1, 1) succeeded
subtraction(1, 2) succeeded
subtraction(1, 3) succeeded
subtraction(1, 4) succeeded
subtraction(1, 715827882) succeeded
subtraction(1, 1073741822) succeeded
subtraction(1, 1073741823) succeeded
subtraction(1, 1073741824) succeeded
subtraction(1, 2147483647) succeeded
subtraction(2, -2147483648) failed
subtraction(2, -1073741825) succeeded
subtraction(2, -1073741824) succeeded
subtraction(2, -1073741823) succeeded
subtraction(2, -715827882) succeeded
subtraction(2, -4) succeeded
subtraction(2, -3) succeeded
subtraction(2, -2) succeeded
subtraction(2, -1) succeeded
subtraction(2, 0) succeeded
subtraction(2, 1) succeeded
subtraction(2, 2) succeeded
subtraction(2, 3) succeeded
subtraction(2, 4) succeeded
subtraction(2, 715827882) succeeded
subtraction(2, 1073741822) succeeded
subtraction(2, 1073741823) succeeded
subtraction(2, 1073741824) succeeded
subtraction(2, 2147483647) succeeded
subtraction(3, -2147483648) failed
subtraction(3, -1073741825) succeeded
subtraction(3, -1073741824) succeeded
subtraction(3, -1073741823) succeeded
subtraction(3, -715827882) succeeded
subtraction(3, -4) succeeded
subtraction(3, -3) succeeded
subtraction(3, -2) succeeded
subtraction(3, -1) succeeded
subtraction(3, 0) succeeded
subtraction(3, 1) succeeded
subtraction(3, 2) succeeded
subtraction(3, 3) succeeded
subtraction(3, 4) succeeded
subtraction(3, 715827882) succeeded
subtraction(3, 1073741822) succeeded
subtraction(3, 1073741823) succeeded
subtraction(3, 1073741824) succeeded
subtraction(3, 2147483647) succeeded
subtraction(4, -2147483648) failed
subtraction(4, -1073741825) succeeded
subtraction(4, -1073741824) succeeded
subtraction(4, -1073741823) succeeded
subtraction(4, -715827882) succeeded
subtraction(4, -4) succeeded
subtraction(4, -3) succeeded
subtraction(4, -2) succeeded
subtraction(4, -1) succeeded
subtraction(4, 0) succeeded
subtraction(4, 1) succeeded
subtraction(4, 2) succeeded
subtraction(4, 3) succeeded
subtraction(4, 4) succeeded
subtraction(4, 715827882) succeeded
subtraction(4, 1073741822) succeeded
subtraction(4, 1073741823) succeeded
subtraction(4, 1073741824) succeeded
subtraction(4, 2147483647) succeeded
subtraction(715827882, -2147483648) failed
subtraction(715827882, -1073741825) succeeded
subtraction(715827882, -1073741824) succeeded
subtraction(715827882, -1073741823) succeeded
subtraction(715827882, -715827882) succeeded
subtraction(715827882, -4) succeeded
subtraction(715827882, -3) succeeded
subtraction(715827882, -2) succeeded
subtraction(715827882, -1) succeeded
subtraction(715827882, 0) succeeded
subtraction(715827882, 1) succeeded
subtraction(715827882, 2) succeeded
subtraction(715827882, 3) succeeded
subtraction(715827882, 4) succeeded
subtraction(715827882, 715827882) succeeded
subtraction(715827882, 1073741822) succeeded
subtraction(715827882, 1073741823) succeeded
subtraction(715827882, 1073741824) succeeded
subtraction(715827882, 2147483647) succeeded
subtraction(1073741822, -2147483648) failed
subtraction(1073741822, -1073741825) succeeded
subtraction(1073741822, -1073741824) succeeded
subtraction(1073741822, -1073741823) succeeded
subtraction(1073741822, -715827882) succeeded
subtraction(1073741822, -4) succeeded
subtraction(1073741822, -3) succeeded
subtraction(1073741822, -2) succeeded
subtraction(1073741822, -1) succeeded
subtraction(1073741822, 0) succeeded
subtraction(1073741822, 1) succeeded
subtraction(1073741822, 2) succeeded
subtraction(1073741822, 3) succeeded
subtraction(1073741822, 4) succeeded
subtraction(1073741822, 715827882) succeeded
subtraction(1073741822, 1073741822) succeeded
subtraction(1073741822, 1073741823) succeeded
subtraction(1073741822, 1073741824) succeeded
subtraction(1073741822, 2147483647) succeeded
subtraction(1073741823, -2147483648) failed
subtraction(1073741823, -1073741825) failed
subtraction(1073741823, -1073741824) succeeded
subtraction(1073741823, -1073741823) succeeded
subtraction(1073741823, -715827882) succeeded
subtraction(1073741823, -4) succeeded
subtraction(1073741823, -3) succeeded
subtraction(1073741823, -2) succeeded
subtraction(1073741823, -1) succeeded
subtraction(1073741823, 0) succeeded
subtraction(1073741823, 1) succeeded
subtraction(1073741823, 2) succeeded
subtraction(1073741823, 3) succeeded
subtraction(1073741823, 4) succeeded
subtraction(1073741823, 715827882) succeeded
subtraction(1073741823, 1073741822) succeeded
subtraction(1073741823, 1073741823) succeeded
subtraction(1073741823, 1073741824) succeeded
subtraction(1073741823, 2147483647) succeeded
subtraction(1073741824, -2147483648) failed
subtraction(1073741824, -1073741825) failed
subtraction(1073741824, -1073741824) failed
subtraction(1073741824, -1073741823) succeeded
subtraction(1073741824, -715827882) succeeded
subtraction(1073741824, -4) succeeded
subtraction(1073741824, -3) succeeded
subtraction(1073741824, -2) succeeded
subtraction(1073741824, -1) succeeded
subtraction(1073741824, 0) succeeded
subtraction(1073741824, 1) succeeded
subtraction(1073741824, 2) succeeded
subtraction(1073741824, 3) succeeded
subtraction(1073741824, 4) succeeded
subtraction(1073741824, 715827882) succeeded
subtraction(1073741824, 1073741822) succeeded
subtraction(1073741824, 1073741823) succeeded
subtraction(1073741824, 1073741824) succeeded
subtraction(1073741824, 2147483647) succeeded
subtraction(2147483647, -2147483648) failed
subtraction(2147483647, -1073741825) failed
subtraction(2147483647, -1073741824) failed
subtraction(2147483647, -1073741823) failed
subtraction(2147483647, -715827882) failed
subtraction(2147483647, -4) failed
subtraction(2147483647, -3) failed
subtraction(2147483647, -2) failed
subtraction(2147483647, -1) failed
subtraction(2147483647, 0) succeeded
subtraction(2147483647, 1) succeeded
subtraction(2147483647, 2) succeeded
subtraction(2147483647, 3) succeeded
subtraction(2147483647, 4) succeeded
subtraction(2147483647, 715827882) succeeded
subtraction(2147483647, 1073741822) succeeded
subtraction(2147483647, 1073741823) succeeded
subtraction(2147483647, 1073741824) succeeded
subtraction(2147483647, 2147483647) succeeded