Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsPowerOfTwo()

static bool Terraria.Graphics.Shaders.MiscShaderData.IsPowerOfTwo ( int n)
inlinestaticprivate

Definition at line 127 of file MiscShaderData.cs.

128 {
129 return (int)Math.Ceiling(Math.Log(n) / Math.Log(2.0)) == (int)Math.Floor(Math.Log(n) / Math.Log(2.0));
130 }
static double Ceiling(double a)
static double Log(double d)
static double Floor(double d)

References System.Math.Ceiling(), System.Math.Floor(), and System.Math.Log().