OmniSciDB  2e3a973ef4
MathUtils.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool isPowOfTwo (unsigned n)
 
unsigned getExpOfTwo (unsigned n)
 

Function Documentation

◆ getExpOfTwo()

unsigned getExpOfTwo ( unsigned  n)

Definition at line 24 of file MathUtils.h.

Referenced by Executor::createErrorCheckControlFlow().

24  {
25  unsigned i = 0;
26 
27  while ((n = n >> 1)) {
28  ++i;
29  }
30 
31  return i;
32 }
+ Here is the caller graph for this function:

◆ isPowOfTwo()

bool isPowOfTwo ( unsigned  n)

Definition at line 20 of file MathUtils.h.

Referenced by Executor::createErrorCheckControlFlow().

20  {
21  return (n & (n - 1)) == 0;
22 }
+ Here is the caller graph for this function: