This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <ctime> | |
| #include <iostream> | |
| int main() | |
| { | |
| // Generate data | |
| const unsigned arraySize = 32768; | |
| int data[arraySize]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Shift 1 over by 8*sizeof(long) - 1 */ | |
| 1L << (sizeof(long)<<3) - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* WARNING: This code is buggy */ | |
| /* Shift 1 over by 8*sizeof(long) - 1 */ | |
| 1L << sizeof(long)<<3 - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int dtmin = -2147483648; | |
| int dcomp2 = (dtmin < 0); | |
| int htmin = 0x80000000; | |
| int hcomp2 = (htmin < 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int dcomp = (-2147483648 < 0); | |
| int hcomp = (0x80000000 < 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Minimum and maximum values a ‘signed int’ can hold. */ | |
| #define INT_MAX 2147483647 | |
| #define INT_MIN (-INT_MAX - 1) |
NewerOlder