ATLAS Offline Software
Loading...
Searching...
No Matches
floaty_t Union Reference
Collaboration diagram for floaty_t:

Public Member Functions

 floaty_t (float n=0.0f)
bool negative () const
 portable extraction of components sign
int32_t raw_mantissa () const
 float has 23 bit mentissa
int32_t raw_exponent () const
 and an 8 bit exponent

Public Attributes

int32_t i
float f

Detailed Description

Definition at line 109 of file computils.cxx.

Constructor & Destructor Documentation

◆ floaty_t()

floaty_t::floaty_t ( float n = 0.0f)
inline

Definition at line 110 of file computils.cxx.

110: f(n) {}

Member Function Documentation

◆ negative()

bool floaty_t::negative ( ) const
inline

portable extraction of components sign

Definition at line 114 of file computils.cxx.

114{ return i < 0; }
int32_t i

◆ raw_exponent()

int32_t floaty_t::raw_exponent ( ) const
inline

and an 8 bit exponent

Definition at line 119 of file computils.cxx.

119{ return (i >> 23) & 0xff; }

◆ raw_mantissa()

int32_t floaty_t::raw_mantissa ( ) const
inline

float has 23 bit mentissa

Definition at line 117 of file computils.cxx.

117{ return i & ((1 << 23) - 1); }

Member Data Documentation

◆ f

float floaty_t::f

Definition at line 122 of file computils.cxx.

◆ i

int32_t floaty_t::i

Definition at line 121 of file computils.cxx.


The documentation for this union was generated from the following file: