Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
bits.cpp File Reference
#include "precompiled.h"
#include "lib/bits.h"
#include <cstring>
Include dependency graph for bits.cpp:

Functions

static u32 get_float_bits (const float x)
 
int floor_log2 (const float x)
 floor(log2(f)) fast, uses the FPU normalization hardware. More...
 

Function Documentation

◆ floor_log2()

int floor_log2 ( const float  x)

floor(log2(f)) fast, uses the FPU normalization hardware.

Parameters
x(float) input; MUST be > 0, else results are undefined.
Returns
floor of the base-2 logarithm (i.e. rounded down).

◆ get_float_bits()

static u32 get_float_bits ( const float  x)
inlinestatic