一群问题
首先是关于《深入理解计算机系统》的:
1.P41 练习题2.14只使用位级和逻辑运算,写出等价x==y
当时对于^的作用理解并不清楚,所以写了一个很冗长的判别式,不知对不对
!(((~x)&y)%%1)
2.P52 练习题2.21
int fun1(unsigned word){return (int) ((word<<24)>>224);}int fun2(unsigned word){return ((int)word<<24)>>24;}
double recip(int demon){return 1.0/(double) demon;}..void test(int demon){double r1,r2;int t1,t2;r1=recip(demon);//stored in memoryr2=recip(demon);//stored in register..}