Skip to content

Instantly share code, notes, and snippets.

View lichenbo's full-sized avatar
🏠
Working from home

Chenbo Li lichenbo

🏠
Working from home
View GitHub Profile
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
// Generate data
const unsigned arraySize = 32768;
int data[arraySize];
/* Shift 1 over by 8*sizeof(long) - 1 */
1L << (sizeof(long)<<3) - 1
/* WARNING: This code is buggy */
/* Shift 1 over by 8*sizeof(long) - 1 */
1L << sizeof(long)<<3 - 1
int dtmin = -2147483648;
int dcomp2 = (dtmin < 0);
int htmin = 0x80000000;
int hcomp2 = (htmin < 0);
int dcomp = (-2147483648 < 0);
int hcomp = (0x80000000 < 0);
/* Minimum and maximum values a ‘signed int’ can hold. */
#define INT_MAX 2147483647
#define INT_MIN (-INT_MAX - 1)