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

Go to the source code of this file.

Functions

UINT64 EFIAPI GetPowerOfTwo64 (IN UINT64 Operand)
 

Detailed Description

Math worker functions.

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

Definition in file GetPowerOfTwo64.c.

Function Documentation

◆ GetPowerOfTwo64()

UINT64 EFIAPI GetPowerOfTwo64 ( IN UINT64  Operand)

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

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

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

Definition at line 26 of file GetPowerOfTwo64.c.