mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 20:12:20 +00:00
* Move shared code to Shared project * Move from Realm to Squealify * Rename Daybreak.Shared namespaces * Setup API project to expose a test API
17 lines
296 B
C#
17 lines
296 B
C#
namespace Daybreak.Shared.Utils;
|
|
|
|
public static class MathUtils
|
|
{
|
|
public static uint RoundUpToTheNextHighestPowerOf2(uint n)
|
|
{
|
|
n--;
|
|
n |= n >> 1;
|
|
n |= n >> 2;
|
|
n |= n >> 4;
|
|
n |= n >> 8;
|
|
n |= n >> 16;
|
|
n++;
|
|
return n;
|
|
}
|
|
}
|