# _fixed.h File Reference

`#include <cmath>`

Go to the source code of this file.

## Classes

class | fixed_base< T, FIXED_BITS >
| Fixed-point template base class. More...
class | fixed_base< T, FIXED_BITS >::raw

## Defines

#define | ETL_FIXED_TYPE int
#define | ETL_FIXED_BITS 12
#define | ETL_FIXED_EPSILON _EPSILON()
#define | ETL_ATTRIB_CONST
#define | ETL_ATTRIB_PURE
#define | ETL_ATTRIB_INLINE

## Typedefs

typedef fixed_base < ETL_FIXED_TYPE, ETL_FIXED_BITS > | fixed

## Functions

template<typename T, unsigned int FIXED_BITS>
_ETL_END_NAMESPACE _STD_BEGIN_NAMESPACE _ETL::fixed_base< T, FIXED_BITS > | abs (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | cos (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | cosh (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | exp (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | log (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | log10 (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | pow (const _ETL::fixed_base< T, FIXED_BITS > &, int)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | pow (const _ETL::fixed_base< T, FIXED_BITS > &, const T &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | pow (const _ETL::fixed_base< T, FIXED_BITS > &, const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | sin (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | sinh (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | sqrt (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | tan (const _ETL::fixed_base< T, FIXED_BITS > &)
template<typename T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | tanh (const _ETL::fixed_base< T, FIXED_BITS > &)
template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > | operator* (const float &lhs, const fixed_base< T, FIXED_BITS > &rhs)
| float * fixed
template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > | operator* (const double &lhs, const fixed_base< T, FIXED_BITS > &rhs)
| double * fixed
template<class T, unsigned int FIXED_BITS>
_ETL_END_NAMESPACE _STD_BEGIN_NAMESPACE _ETL::fixed_base< T, FIXED_BITS > | ceil (const _ETL::fixed_base< T, FIXED_BITS > &rhs)
template<class T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | floor (const _ETL::fixed_base< T, FIXED_BITS > &rhs)
template<class T, unsigned int FIXED_BITS>
_ETL::fixed_base< T, FIXED_BITS > | round (const _ETL::fixed_base< T, FIXED_BITS > &rhs)

## Define Documentation

#define ETL_FIXED_TYPE int

======================================================================== Extended Template and Library Fixed-Point Math Class Implementation $Id$

Copyright (c) 2002 Robert B. Quattlebaum Jr. Copyright (c) 2007 Chris Moore

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

=== N O T E S ===========================================================

This is an internal header file, included by other ETL headers. You should not attempt to use it directly.

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

Definition at line 42 of file _fixed.h.

#define ETL_FIXED_BITS 12

Definition at line 46 of file _fixed.h.

#define ETL_FIXED_EPSILON _EPSILON()

Definition at line 50 of file _fixed.h.

#define ETL_ATTRIB_CONST

Definition at line 58 of file _fixed.h.

#define ETL_ATTRIB_PURE

Definition at line 59 of file _fixed.h.

#define ETL_ATTRIB_INLINE

Definition at line 60 of file _fixed.h.

## Typedef Documentation

typedef fixed_base<ETL_FIXED_TYPE,ETL_FIXED_BITS> fixed

Definition at line 549 of file _fixed.h.

## Function Documentation

template<typename T, unsigned int FIXED_BITS>

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

Definition at line 572 of file _fixed.h.

Referenced by angle::abs(), angle::operator!(), angle::operator!=(), angle::operator==(), and surface< T, AT, VP >::surface().

template<typename T, unsigned int FIXED_BITS>

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

Referenced by surface< T, AT, VP >::cosine_sample(), and angle::cos::get().

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

Referenced by angle::sin::get().

template<typename T, unsigned int FIXED_BITS>

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

template<typename T, unsigned int FIXED_BITS>

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

Referenced by distance_func< V >::uncook().

template<typename T, unsigned int FIXED_BITS>

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

Referenced by angle::tan::get().

template<typename T, unsigned int FIXED_BITS>

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

template<class T, unsigned int FIXED_BITS>

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

float * fixed

Definition at line 440 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

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

double * fixed

Definition at line 447 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>

_ETL_END_NAMESPACE _STD_BEGIN_NAMESPACE _ETL::fixed_base<T,FIXED_BITS> ceil | ( | const _ETL::fixed_base< T, FIXED_BITS > & | rhs | ) | `[inline]`

Definition at line 557 of file _fixed.h.

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

Referenced by ceil_to_int().

template<class T, unsigned int FIXED_BITS>

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

Definition at line 562 of file _fixed.h.

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

Referenced by surface< T, AT, VP >::cubic_sample(), fastangle::dist(), fastangle::mod(), fastangle::operator~(), surface< T, AT, VP >::sample_rect(), surface< T, AT, VP >::sample_rect_clip(), and clock_desc_gettimeofday::seconds_to_timestamp().

template<class T, unsigned int FIXED_BITS>

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

Definition at line 567 of file _fixed.h.

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