请解释 [英] Plz explain

查看:103
本文介绍了请解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int多项式& = 0xFFFF;

请解释这行我没听懂.
在广告中表示感谢.

int polynom &= 0xFFFF;

Plz explain this line I am not geting.
thanks in adv.

推荐答案

它是一行垃圾.
Its a line of rubbish.
int polynom

声明一个称为"polynom"的整数并将其值设置为零.

Declares an integer called "polynom" and sets it''s value to zero.

polynom &= 0xFFFF

在多项式"的当前值和十六进制FFFF(十六位,全为"1")之间执行逻辑与,并将结果替换为多项式"的当前值.

Performs a logical AND between the current value of "polynom" and hexadecimal FFFF (sixteen bits, all ''1''s), and replaces the current value of "polynom" with the result.
I.e.

int polynom &= 0xFFFF;

声明一个称为"polynom"的整数并将其值设置为零-因为从逻辑上讲,0与任何值进行逻辑与运算就得出了零.

declares in integer called "polynom" and sets it''s value to zero - since 0 logically ANDed with anything gives zero by definition.


删除&

这将把polynnom声明为一个int并将其值设置为0xFFFF(十进制数为35535)
Remove the &

This will declare polynnom as an int and set its value to 0xFFFF (65535 decimal)


如果多项式是16位数字,则按位进行运算,其值为16 1",因此不会有发生
如果多项式> 16位,则它将删除> 2 ^ 16
If the polynom is a 16 bit number then you bitwise and it with 16 1''s hence nothing will happen
if polynom > 16 bit then it will remove the bits >2 ^16


这篇关于请解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆