예제 #1
0
파일: t2-95.c 프로젝트: BrieflyX/csapp
int main(void)
{
    float f;
    unsigned u, t;

    int i = INT_MIN;
    do {
        f = (float) i;
        u = f2u(f);
        t = float_i2f(i);
        if (u != t)
            printf("BAD: 0x%X, 0x%X, 0x%X\n", t, i, u);
    } while (i++ != INT_MAX);

    return 0;
}
예제 #2
0
int main() {
  printf("Test with main.\n");
  printf("bitAnd Result: %d\n", bitAnd(15,3));
  printf("getByte Result: %d \n",getByte(0x12345678,22));
  printf("bitcount Result: %d \n", bitCount(1));
  printf("bang result is: %d \n", bang(3));
  printf("minimum two's complement integer is: %d \n",tmin());
  printf("fitbits result is: %d \n",fitsBits(-4,3));
  printf("divpwr2 result  is: %d \n",divpwr2(-33,4));
  printf("negate result is: %d \n",negate(4));
  printf("isPositive result is: %d \n",isPositive(-4));
  printf("isLessOrEqual result is: %d \n",isLessOrEqual(5,5));
  printf("float_neg result is: %d \n",float_neg(13));
  printf("float_i2f result is: %d \n",float_i2f(15));
  printf("float_twice result is: %d \n",float_twice(9.84));

}
예제 #3
0
파일: hello.c 프로젝트: samparly/Homework
int main(int argc, char* argv[]){
	int x = 0x80000001;
	show_int(float_i2f(x));
	return 0;
}