Re: SourceComment: I am back ;-) and algorithm for PowerOf2

Atul, that’s a really nice trick :-). Pushed in your public branch!

Regards,
Peter

Would you like to post a relpy?


This post is a reply to:
SourceComment: I am back ;-) and algorithm for PowerOf2
Dear all, static bool isPowerOf2 (quint32 size) { while ((size & 0x01) == 0) size >>= 1; return size == 1; } A faster version could be static bool isPowerOf2 (quint32 size) { if( size == 0 ) return false; return (more...)

No follow-ups yet.