《计算机科学导论》课后练习(翻译)(15)
时间:2026-01-22
时间:2026-01-22
of allocated values.
“溢出”的发生是指算术运算的结果超出其所能表示的范围。
5.在浮点数的加法运算中,怎样调整指数不同的数的表示方法?
答:The decimal point of the number with the smaller exponent is shifted to the left until the exponents are equal.
在浮点数的加法运算中,增加较小的指数,移位相应的尾数,直到两个数具有相同的指数。
6.一元运算和二元运算有何不同?
答:A unary operation takes a single operand. A binary operation takes two operands. 一元运算只有一个操作数,二元运算有两个操作数。
7.二元逻辑运算有哪些?
答:The common logical binary operations are: AND, OR, and XOR.
8.什么是真值表?
答:A truth table lists all possible input combinations with the corresponding outputs. 真值表就是列出所有可能的输入组合以及相应输出的表。
9.非运算符的作用是什么?
答:The NOT operation inverts logical values (bits): it changes true to false and false to true.
非运算符的作用是对逻辑值(位)取反,它把真变成假,把假变成真。
10.与运算符的结果何时为真?
答:The result of an AND operation is true when both of the operands are true.
11.或运算符的结果何时为真?
答:The result of an OR operation is true when one or both of the operands are true.
12.异或运算符的结果何时为真?
答:The result of an XOR operator is true when the operands are different.
13.说出AND运算符本章讨论的一个重要特性。
答:An important property of the AND operator is that if one of the operands is false, the result is false.
14.说出OR运算符本章讨论的一个重要特性。
答:An important property of the OR operator is that if one of the operands is true, the result is true.
15.说出XOR运算符本章讨论的一个重要特性。
答:An important property of the XOR operator is that if one of the operands is true, the result will be the inverse of the other operand.
16.哪种二元运算可以用来置位?掩码应该用什么位模式?
答:The OR operator can be used to set bits. Set the desired positions in the mask to 1. 或运算可以用来置位。掩码中的1位对第一个输入中的相应的位进行置位,而掩码中的0位使第一个输入中相应的位保持不变。
17. 哪种二元运算可以用来复位?掩码应该用什么位模式?
答:The AND operator can be used to clear bits. Set the desired positions in the mask to 0.
与运算可以用来复位,掩码中的0对第一个输入中相应的位进行复位。掩码中的1位使得第一个输入中相应的位保持不变。
18. 哪种二元运算可以用来反转?掩码应该用什么位模式?
上一篇:氟康唑与其他药物的相互作用