TianoCore EDK2 master
Loading...
Searching...
No Matches
GetPowerOfTwo32.c File Reference
#include "BaseLibInternals.h"

Go to the source code of this file.

Functions

UINT32 EFIAPI GetPowerOfTwo32 (IN UINT32 Operand)
 

Detailed Description

Math worker functions.

Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file GetPowerOfTwo32.c.

Function Documentation

◆ GetPowerOfTwo32()

UINT32 EFIAPI GetPowerOfTwo32 ( IN UINT32  Operand)

Returns the value of the highest bit set in a 32-bit value. Equivalent to 1 << log2(x).

This function computes the value of the highest bit set in the 32-bit value specified by Operand. If Operand is zero, then zero is returned.

Parameters
OperandThe 32-bit operand to evaluate.
Returns
1 << HighBitSet32(Operand)
Return values
0Operand is zero.

Definition at line 26 of file GetPowerOfTwo32.c.