Functions
in package
Static helper functions
Tags
Table of Contents
- isPowerOf2() : bool
- Checks if the number is a power of 2
- nestedCount() : int
- Calculate a count of 2D array
- nextPowerOf2() : int
- Get the next power of 2 larger than input
- previousPowerOf2() : int
- Get the previous power of 2 smaller or equal than input
Methods
isPowerOf2()
Checks if the number is a power of 2
public
static isPowerOf2(int $x) : bool
Parameters
- $x : int
Return values
bool —nestedCount()
Calculate a count of 2D array
public
static nestedCount(array<string|int, array<string|int, mixed>> $array) : int
Parameters
- $array : array<string|int, array<string|int, mixed>>
Return values
int —nextPowerOf2()
Get the next power of 2 larger than input
public
static nextPowerOf2(int $x) : int
Parameters
- $x : int
Return values
int —previousPowerOf2()
Get the previous power of 2 smaller or equal than input
public
static previousPowerOf2(int $x) : int
Parameters
- $x : int