FGenericPlatformMath::FloorLog2

Computes the base 2 logarithm for an integer value that is greater than 0.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h

Include

#include "GenericPlatform/GenericPlatformMath.h"

Syntax

static uint32 FloorLog2
(
    uint32 Value
)

Remarks

Computes the base 2 logarithm for an integer value that is greater than 0. The result is rounded down to the nearest integer.

Returns

Log2 of Value. 0 if Value is 0.

Parameters

Parameter

Description

Value

The value to compute the log of