(num > 0) && (((num - 1) & num) == 0) ?
所在版块:
求学狮城
发贴时间:2007-04-26 00:31
评分:
用户信息
昵称:
这就是生活
经验: 477
等级: 3 略知一二
资产:
589
华新币
发贴: 535
在线: 188.3 小时
复制本帖HTML代码
我要回复↙
相关跟贴↙
平板模式
手机浏览
下一跟贴
只看此人
本帖链接
字体:
小
中
大
高亮
:
今天贴
X
昨天贴
X
前天贴
X
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!
1234 2234 3234 4234...............
相关帖子
我要回复↙
↗回到正文
programming puzzles
-
吴永铮
2007-04-24 17:12
(
476 bytes , 736reads
)
my answer to (4)
-
吴永铮
2007-04-27 21:56
(
284 bytes , 253reads
)
(Y)
-
hash
2007-04-29 04:42
(
0 bytes , 225reads
)
what do you mean by classic way?
-
icky
2007-04-25 11:33
(
96 bytes , 265reads
)
(3) can be done by less than 5 instructions
-
吴永铮
2007-04-25 12:26
(
66 bytes , 255reads
)
check equality with all 2's power
-
icky
2007-04-25 12:56
(
31 bytes , 292reads
)
can be simpler and faster
-
吴永铮
2007-04-25 15:26
(
0 bytes , 226reads
)
先模1<<16和除 1<<16
-
icky
2007-04-25 16:46
(
130 bytes , 246reads
)
(num > 0) && (((num - 1) & num) == 0) ?
-
这就是生活
2007-04-26 00:31
(
0 bytes , 265reads
)
correct
-
吴永铮
2007-04-26 00:50
(
177 bytes , 233reads
)
opps ^ is wrong. It's always true.
-
吴永铮
2007-04-26 01:06
(
0 bytes , 243reads
)
i was thinking of checking bit also.
-
hash
2007-04-25 11:36
(
18 bytes , 255reads
)
interesting... let me try 1&2...
-
hash
2007-04-24 18:10
(
106 bytes , 379reads
)
oh, i was thinking using while
-
icky
2007-04-25 11:34
(
55 bytes , 301reads
)
世界真奇妙
-
soc胖浪人
2007-04-25 00:27
(
0 bytes , 201reads
)