1

Why is that most of the textbooks and reference books always write TMin32 as -2147483647-1 and not simply as either -2147483648 or 0x80000000?

jimo
  • 430
  • 2
  • 7
  • 19
  • 5
    I'm guessing here. Because first the parser has to parse the positive number, before applying the unary minus (-), and 2147483648 is not legal as a positive 32-bit number. – Mike Dunlavey May 12 '15 at 14:43
  • 1
    Your guess is correct. See here: http://www.cprogramdevelop.com/3963023/ "Note that the compiler processes a form-X expression method is to first read the expression X then it negated on a 32-bit integer, Tmin32 = -2147483648 will produce overflow, so Tmin32 = -2147483647-1." – NinjaCat May 12 '15 at 14:51
  • [Why do we define INT_MIN as -INT_MAX - 1?](https://stackoverflow.com/q/26003893/995714) – phuclv Sep 12 '18 at 03:14

0 Answers0