FMath::IsPowerOfTwo() returns true for 0

The implementation (Value & (Value - 1) == 0) returns true for powers of two (including 2^0 = 1), but also trivially returns true for 0, which is presumably unintended. Should be simple enough to fix.

Thats sounds more like compiler issue not UE4

I was stating that the implementation they have for the function returns true for 0 as well as powers of two. 0 & -1 == 0, regardless of compiler.

ah sorry you right is function, i’m stupid now i get it >.< if you know the fix why dont you submit the fix yourself on github? :stuck_out_tongue:

Hello,

Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes.

If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, please submit a new report for it.

Thank you.