Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var
  2. c1, c2 : boolean;
  3. x, i : integer;
  4. begin
  5. // ...
  6. c1 := x > 0 and y > INT_MAX - x; // Переполнение в положительную сторону
  7. c2 := x < 0 and y < INT_MIN - y; // Переполнение в отрицательную сторону
  8. if c1 = True and c2 = True then
  9. begin
  10. // Тут выводим ошибку и закрываем
  11. end;
  12. else // ...
  13. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement