4 + 2 = 6
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <libguile/scm.h>
|
||||
|
||||
#define BLAH (-1 >> 2 == -1) && (-4 >> 2 == -1) && (-5 >> 2 == -2) && (-8 >> 2 == -2)
|
||||
|
||||
#if BLAH
|
||||
# define SCM_SRS(x, y) ((x) >> (y))
|
||||
#else
|
||||
# define SCM_SRS(x, y) \
|
||||
((x) < 0 \
|
||||
? -1 - (scm_t_signed_bits) (~(scm_t_bits)(x) >> (y)) \
|
||||
: ((x) >> (y)))
|
||||
#endif
|
||||
|
||||
int main () {
|
||||
unsigned long mask = 0xfffffffffffffffe;
|
||||
unsigned long x = (4 << 2) + 2;
|
||||
unsigned long y = (2 << 2) + 2;
|
||||
unsigned long z = ((x + y) >> 2) + 2;
|
||||
printf ("BLAH: %d\n", BLAH);
|
||||
printf ("%ld\n", sizeof(long));
|
||||
printf ("%lx\n", (long) z >> 2);
|
||||
}
|
||||
Reference in New Issue
Block a user