随笔分类 -  计算机

CS:APP datalab
摘要:做得有点慢,位运算确实不太容易想到…… 写出来的代码如果没有注释也不容易看懂。 1 /* 2 * CS:APP Data Lab 3 * 4 * <Please put your name and userid here> 5 * 6 * bits.c - Source file with your 阅读全文
posted @ 2018-02-06 20:34 苛性氢 阅读(336) 评论(0) 推荐(0)
位运算实现三元表达式
摘要:15213 - Recitation 3 - Datalab Find an algorithm for computing the expression (cond) ? t : f , which equals t if cond is1 and f if cond is 0. ________ 阅读全文
posted @ 2018-02-03 17:32 苛性氢 阅读(262) 评论(0) 推荐(0)
浮点数不用补码表示
摘要:补码是用来表示整数的(定点小数也看成整数)。 现在的浮点数表示基本都参考了IEEE-754标准。 (–1)s*M*2E ,M是1~2之间的小数。 不能用补码,照样可以加减,怎么做,那是另一回事。 阅读全文
posted @ 2018-01-29 09:04 苛性氢 阅读(311) 评论(0) 推荐(0)