CAS操作包含三个操作数——内存位置(V)、预期原值(A)和新值(B)。
A CAS operation includes three operands — a memory location (v), the expected old value (a), and a new value (B).
可以在输入和输出部分中同时使用多个操作数。
In some cases, a single variable may serve as both the input and the output operand.
如果任意一个操作数是浮点型的,则所有操作数都将按浮点型进行计算,并且结果也是浮点型的。
If any of the operands is a float, then all operands are evaluated as floats, and the results are floats.
Let's say you have to go through three or four operations to get a final number, well, do it algebraically.
让我们说,你不得不通过3-4个操作,才能得到最终的数,好吧,用代数方法求解。
Just take a look: if this is 9, 5 divided by 9 is always going to be 0 point something, and if you thus have two integers and you're rounding down, which is what happens when you do integral math we're using this operator, I'm going to get zero times whatever.
稍微看一看:如果这是9,5除以9会得到,0点几,如果你用两个整型数,你舍去小数,这就是当你们,用整型数使用这个操作的所发生的事情,我将得到数值0乘以任何一个数字。
应用推荐