| 1 |
# test integer limits. Set and print variables and print constants. |
| 2 |
|
| 3 |
probe begin { |
| 4 |
|
| 5 |
|
| 6 |
long_max = 2147483647; |
| 7 |
ulong_max = 4294967295; |
| 8 |
long_min = -2147483647-1; |
| 9 |
long_min2 = -2147483648; |
| 10 |
|
| 11 |
printf("Maximum signed 32-bit number\n") |
| 12 |
printf("%d 0x%x\n", long_max, long_max) |
| 13 |
printf("%d 0x%x\n", 2147483647, 2147483647) |
| 14 |
printf("%d 0x%x\n", 0x7fffffff, 0x7fffffff) |
| 15 |
|
| 16 |
printf("\nMaximum unsigned 32-bit number\n") |
| 17 |
printf("%d 0x%x\n", ulong_max, ulong_max) |
| 18 |
printf("%d 0x%x\n", 4294967295, 4294967295) |
| 19 |
printf("%d 0x%x\n", 0xffffffff, 0xffffffff) |
| 20 |
|
| 21 |
printf("\nMinimum signed 32-bit number\n") |
| 22 |
printf("%d 0x%x\n", long_min, long_min) |
| 23 |
printf("%d 0x%x\n", long_min2, long_min2) |
| 24 |
printf("%d 0x%x\n", -2147483648, -2147483648) |
| 25 |
printf("%d 0x%x\n", 0xffffffff80000000, 0xffffffff80000000) |
| 26 |
|
| 27 |
llong_max = 9223372036854775807; |
| 28 |
ullong_max = 18446744073709551615; |
| 29 |
llong_min = -9223372036854775807-1; |
| 30 |
llong_min2 = -9223372036854775808; |
| 31 |
llong_min3 = 9223372036854775808; |
| 32 |
|
| 33 |
printf("\nMaximum signed 64-bit number\n") |
| 34 |
printf("%d 0x%x\n", llong_max, llong_max) |
| 35 |
printf("%d 0x%x\n", 9223372036854775807, 9223372036854775807) |
| 36 |
printf("%d 0x%x\n", 0x7fffffffffffffff, 0x7fffffffffffffff) |
| 37 |
|
| 38 |
printf("\nMaximum unsigned 64-bit number\n") |
| 39 |
printf("%ud 0x%x\n", ullong_max, ullong_max) |
| 40 |
printf("%ud 0x%x\n", 18446744073709551615, 18446744073709551615) |
| 41 |
printf("%ud 0x%x\n", 0xffffffffffffffff, 0xffffffffffffffff) |
| 42 |
|
| 43 |
printf("\nMinimum signed 64-bit number\n") |
| 44 |
printf("%d 0x%x\n", llong_min, llong_min) |
| 45 |
printf("%d 0x%x\n", llong_min2, llong_min2) |
| 46 |
printf("%d 0x%x\n", llong_min3, llong_min3) |
| 47 |
printf("%d 0x%x\n", -9223372036854775808, -9223372036854775808) |
| 48 |
printf("%d 0x%x\n", 0x8000000000000000, 0x8000000000000000) |
| 49 |
|
| 50 |
exit() |
| 51 |
} |