Live data from Hacker News

Ten Ways to Check if an Integer Is a Power Of Two in C

exploringbinary.com

1–10 of 82 posts

Re: Ten Ways to Check if an Integer Is a Power Of Two in C

#6
post #4
post #3

Earlier quoted context omitted.

It is method #9.

[deleted]

Because the methods clearly get more complicated. Starting simply and naively and then improving is a perfectly standard way of teaching.

Articles like these, which provide detailed explanation of the methods involved and results of benchmarks help greatly.

Re: Ten Ways to Check if an Integer Is a Power Of Two in C

#9
post #6
post #4

Earlier quoted context omitted.

[deleted]

Because the methods clearly get more complicated. Starting simply and naively and then improving is a perfectly standard way of teaching. Articles like these, which provide detailed explanation of the methods involved and results of benchmarks help greatly.

[deleted]
Post reply on HN