You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 16, 2023. It is now read-only.
this is not a bug or something like that, but I think, you can optimize your code. https://github.com/lxndr/vtf/blob/master/vtf.cpp#L88
The method in this file isPowerOfTwo has a loop and can not recognize sizes > 32768.
The faster way is a simple macro:
Hello,
this is not a bug or something like that, but I think, you can optimize your code.
https://github.com/lxndr/vtf/blob/master/vtf.cpp#L88
The method in this file isPowerOfTwo has a loop and can not recognize sizes > 32768.
The faster way is a simple macro:
define IS_POWER_OF_TWO(t) ( t > 0 && !(t & (t − 1)))
The simple reason for this is that powers of two look in binary like this:
1: 0001
2: 0010
4: 0100
8: 1000
Everytime, there is exacly one bit set.
The text was updated successfully, but these errors were encountered: