I have misbehaving code that looks like this: (events is an NSArray with one element when this code executes)

```
MAX(0, self.events.count-2)

```

I expect the result of the expression to be 0, but it produces -1. Checking NSObjCRuntime.h, MAX() looks like this:

```
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })

```

With lldb, I see the following:

```
(lldb) p (int)[[self events] count]
(int) $0 = 1
(lldb) p (int)[[self events] count] - 2
(int) $1 = -1
(lldb) p (BOOL)[[self events] count] - 2 < 0
(bool) $2 = true
(lldb) p (BOOL)0 > [[self events] count] - 2
(bool) $3 = false

```

Huh? Maybe it's operator precedence, but...

```
(lldb) p (BOOL)(0 > [[self events] count] - 2)
(BOOL) $4 = NO
(lldb) p (BOOL)(0 > ([[self events] count] - 2))
(BOOL) $5 = NO

```

Weird also that the debugger changes over to caps BOOL/YES/NO after the first funny answer. One might suppose from the foregoing that this code would behave differently:

```
MAX(0, self.events.count-2)

```

...but, and maybe I'm happy about some sanity here, this works wrongly the same way. I must be missing something basic about syntax, but I cannot spot it.