FMath::IsPowerOfTwo

Checks whether a number is a power of two.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Syntax

template<typename T>
static bool IsPowerOfTwo
(
    T Value
)

Remarks

Checks whether a number is a power of two.

Returns

true if Value is a power of two

Parameters

Parameter

Description

Value

Number to check

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss