# fixed_base< T, FIXED_BITS > Class Template Reference

Fixed-point template base class. More...

`#include <_fixed.h>`

List of all members.

## Public Types

typedef T | value_type

## Public Member Functions

| fixed_base () ETL_ATTRIB_INLINE
| fixed_base (const float &f) ETL_ATTRIB_INLINE
| fixed_base (const double &f) ETL_ATTRIB_INLINE
| fixed_base (const long double &f) ETL_ATTRIB_INLINE
| fixed_base (const int &i) ETL_ATTRIB_INLINE
| fixed_base (const int &n, const int &d) ETL_ATTRIB_INLINE
| Fraction constructor.
| fixed_base (const _fixed &x) ETL_ATTRIB_INLINE
| fixed_base (value_type x, raw) ETL_ATTRIB_INLINE
T & | data () ETL_ATTRIB_PURE ETL_ATTRIB_INLINE
const T & | data () const ETL_ATTRIB_PURE ETL_ATTRIB_INLINE
const _fixed & | operator+= (const _fixed &rhs) ETL_ATTRIB_INLINE
| fixed+=fixed
const _fixed & | operator-= (const _fixed &rhs) ETL_ATTRIB_INLINE
| fixed-=fixed
template<typename U>
const _fixed & | operator*= (const U &rhs) ETL_ATTRIB_INLINE
template<typename U>
const _fixed & | operator/= (const U &rhs) ETL_ATTRIB_INLINE
const _fixed & | operator*= (const _fixed &rhs) ETL_ATTRIB_INLINE
| fixed*=fixed
const _fixed & | operator/= (const _fixed &rhs) ETL_ATTRIB_INLINE
| fixed/=fixed
const _fixed & | operator*= (const int &rhs) ETL_ATTRIB_INLINE
| fixed*=int
const _fixed & | operator/= (const int &rhs) ETL_ATTRIB_INLINE
| fixed/=int
template<typename U>
_fixed | operator+ (const U &rhs) const ETL_ATTRIB_INLINE
| fixed + ...
template<typename U>
_fixed | operator- (const U &rhs) const ETL_ATTRIB_INLINE
| fixed - ...
template<typename U>
_fixed | operator* (const U &rhs) const ETL_ATTRIB_INLINE
| fixed * ...
template<typename U>
_fixed | operator/ (const U &rhs) const ETL_ATTRIB_INLINE
| fixed / ...
_fixed | operator+ (const _fixed &rhs) const ETL_ATTRIB_INLINE
| fixed + fixed
_fixed | operator- (const _fixed &rhs) const ETL_ATTRIB_INLINE
| fixed - fixed
_fixed | operator* (const _fixed &rhs) const ETL_ATTRIB_INLINE
| fixed * fixed
_fixed | operator/ (const _fixed &rhs) const ETL_ATTRIB_INLINE
| fixed / fixed
_fixed | operator* (const int &rhs) const ETL_ATTRIB_INLINE
| fixed * int
_fixed | operator/ (const int &rhs) const ETL_ATTRIB_INLINE
| fixed / int
_fixed | operator* (const float &rhs) const ETL_ATTRIB_INLINE
| fixed * float
_fixed | operator* (const double &rhs) const ETL_ATTRIB_INLINE
| fixed * double
_fixed | operator- () const ETL_ATTRIB_INLINE
| operator float () const ETL_ATTRIB_INLINE
| operator double () const ETL_ATTRIB_INLINE
| operator long double () const ETL_ATTRIB_INLINE
| operator int () const ETL_ATTRIB_INLINE
| operator bool () const ETL_ATTRIB_INLINE
_fixed | floor () const
_fixed | ceil () const
_fixed | round () const
bool | operator== (const _fixed &rhs) const
bool | operator!= (const _fixed &rhs) const
bool | operator< (const _fixed &rhs) const
bool | operator> (const _fixed &rhs) const
bool | operator<= (const _fixed &rhs) const
bool | operator>= (const _fixed &rhs) const

## Private Types

typedef fixed_base< T, FIXED_BITS > | _fixed
typedef fixed_base< T, FIXED_BITS > | self_type

## Static Private Member Functions

static bool | _TYPE_SMALLER_THAN_INT () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static bool | _USING_ALL_BITS () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static value_type | _ONE () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static value_type | _F_MASK () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static float | _EPSILON () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE

## Private Attributes

T | _data

## Classes

class | raw

## Detailed Description

### template<class T, unsigned int FIXED_BITS>
class fixed_base< T, FIXED_BITS >

Fixed-point template base class.

========================================================================

A more detailed description needs to be written.

Definition at line 100 of file _fixed.h.

## Member Typedef Documentation

template<class T, unsigned int FIXED_BITS>

typedef T fixed_base< T, FIXED_BITS >::value_type

Definition at line 103 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

typedef fixed_base<T,FIXED_BITS> fixed_base< T, FIXED_BITS >::_fixed `[private]`

Definition at line 107 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

typedef fixed_base<T,FIXED_BITS> fixed_base< T, FIXED_BITS >::self_type `[private]`

Definition at line 108 of file _fixed.h.

## Constructor & Destructor Documentation

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( |  | ) | `[inline]`

Definition at line 177 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const float & | f | ) | `[inline]`

Definition at line 185 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const double & | f | ) | `[inline]`

Definition at line 192 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const long double & | f | ) | `[inline]`

Definition at line 199 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const int & | i | ) | `[inline]`

Definition at line 206 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const int & | n,
|  | const int & | d |
| ) |  |  | `[inline]`

Fraction constructor.

Definition at line 213 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | const _fixed & | x | ) | `[inline]`

Definition at line 181 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::fixed_base | ( | value_type | x,
|  | raw |  |
| ) |  |  | `[inline]`

Definition at line 210 of file _fixed.h.

## Member Function Documentation

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT | ( |  | ) | `[inline, static, private]`

Definition at line 218 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::operator*=(), and fixed_base< T, FIXED_BITS >::operator/=().

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::_USING_ALL_BITS | ( |  | ) | `[inline, static, private]`

Definition at line 224 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>

T fixed_base< T, FIXED_BITS >::_ONE | ( |  | ) | `[inline, static, private]`

Definition at line 230 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_USING_ALL_BITS().

Referenced by fixed_base< T, FIXED_BITS >::_EPSILON(), fixed_base< T, FIXED_BITS >::_F_MASK(), fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::operator double(), fixed_base< T, FIXED_BITS >::operator float(), fixed_base< T, FIXED_BITS >::operator long double(), and fixed_base< T, FIXED_BITS >::round().

template<class T, unsigned int FIXED_BITS>

T fixed_base< T, FIXED_BITS >::_F_MASK | ( |  | ) | `[inline, static, private]`

Definition at line 236 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_ONE(), and fixed_base< T, FIXED_BITS >::_USING_ALL_BITS().

Referenced by fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::floor(), and fixed_base< T, FIXED_BITS >::round().

template<class T, unsigned int FIXED_BITS>

float fixed_base< T, FIXED_BITS >::_EPSILON | ( |  | ) | `[inline, static, private]`

Definition at line 242 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>

T & fixed_base< T, FIXED_BITS >::data | ( |  | ) | `[inline]`

Definition at line 249 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

Referenced by fastangle::cos::cos(), fastangle::tan::get(), fastangle::cos::get(), fastangle::sin::get(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator!=(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator<(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator<=(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator==(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator>(), fixed_base< ETL_FIXED_TYPE, ETL_FASTANGLE_LOOKUP_RES >::operator>=(), fastangle::sin::sin(), and fastangle::tan::tan().

template<class T, unsigned int FIXED_BITS>

const T & fixed_base< T, FIXED_BITS >::data | ( |  | ) | const`[inline]`

Definition at line 255 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator+= | ( | const _fixed & | rhs | ) | `[inline]`

fixed+=fixed

Definition at line 262 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator-= | ( | const _fixed & | rhs | ) | `[inline]`

fixed-=fixed

Definition at line 270 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
template<typename U>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator*= | ( | const U & | rhs | ) | `[inline]`

Definition at line 306 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= | ( | const U & | rhs | ) | `[inline]`

Definition at line 312 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator*= | ( | const _fixed & | rhs | ) | `[inline]`

fixed*=fixed

Definition at line 278 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT().

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= | ( | const _fixed & | rhs | ) | `[inline]`

fixed/=fixed

Definition at line 293 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT().

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator*= | ( | const int & | rhs | ) | `[inline]`

fixed*=int

Definition at line 319 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= | ( | const int & | rhs | ) | `[inline]`

fixed/=int

Definition at line 326 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
template<typename U>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator+ | ( | const U & | rhs | ) | const`[inline]`

fixed + ...

Definition at line 377 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator- | ( | const U & | rhs | ) | const`[inline]`

fixed - ...

Definition at line 384 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::operator-().

template<class T, unsigned int FIXED_BITS>
template<typename U>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator* | ( | const U & | rhs | ) | const`[inline]`

fixed * ...

Definition at line 391 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ | ( | const U & | rhs | ) | const`[inline]`

fixed / ...

Definition at line 398 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator+ | ( | const _fixed & | rhs | ) | const`[inline]`

fixed + fixed

Definition at line 339 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator- | ( | const _fixed & | rhs | ) | const`[inline]`

fixed - fixed

Definition at line 348 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator* | ( | const _fixed & | rhs | ) | const`[inline]`

fixed * fixed

Definition at line 357 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ | ( | const _fixed & | rhs | ) | const`[inline]`

fixed / fixed

Definition at line 367 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator* | ( | const int & | rhs | ) | const`[inline]`

fixed * int

Definition at line 405 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ | ( | const int & | rhs | ) | const`[inline]`

fixed / int

Definition at line 430 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator* | ( | const float & | rhs | ) | const`[inline]`

fixed * float

Definition at line 415 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator* | ( | const double & | rhs | ) | const`[inline]`

fixed * double

Definition at line 422 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator- | ( |  | ) | const`[inline]`

Definition at line 459 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

Referenced by fixed_base< T, FIXED_BITS >::operator-().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::operator float | ( |  | ) | const`[inline]`

Definition at line 466 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::operator double | ( |  | ) | const`[inline]`

Definition at line 472 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::operator long double | ( |  | ) | const`[inline]`

Definition at line 478 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::operator int | ( |  | ) | const`[inline]`

Definition at line 484 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS >::operator bool | ( |  | ) | const`[inline]`

Definition at line 490 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::floor | ( |  | ) | const`[inline]`

Definition at line 497 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_F_MASK().

Referenced by floor().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::ceil | ( |  | ) | const`[inline]`

Definition at line 505 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

Referenced by ceil().

template<class T, unsigned int FIXED_BITS>

fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::round | ( |  | ) | const`[inline]`

Definition at line 516 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

Referenced by round().

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator== | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 167 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator!= | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 168 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator< | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 169 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator> | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 170 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator<= | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 171 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

bool fixed_base< T, FIXED_BITS >::operator>= | ( | const _fixed & | rhs | ) | const`[inline]`

Definition at line 172 of file _fixed.h.

## Member Data Documentation

template<class T, unsigned int FIXED_BITS>

T fixed_base< T, FIXED_BITS >::_data `[private]`

Definition at line 105 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::data(), fixed_base< T, FIXED_BITS >::floor(), fixed_base< T, FIXED_BITS >::operator bool(), fixed_base< T, FIXED_BITS >::operator double(), fixed_base< T, FIXED_BITS >::operator float(), fixed_base< T, FIXED_BITS >::operator int(), fixed_base< T, FIXED_BITS >::operator long double(), fixed_base< T, FIXED_BITS >::operator*(), fixed_base< T, FIXED_BITS >::operator*=(), fixed_base< T, FIXED_BITS >::operator+(), fixed_base< T, FIXED_BITS >::operator+=(), fixed_base< T, FIXED_BITS >::operator-(), fixed_base< T, FIXED_BITS >::operator-=(), fixed_base< T, FIXED_BITS >::operator/(), fixed_base< T, FIXED_BITS >::operator/=(), and fixed_base< T, FIXED_BITS >::round().

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

- _fixed.h