fixed: add accessor for raw int values

This commit is contained in:
Danny Robson 2014-12-05 13:20:23 +11:00
parent c2d608410b
commit 331ea58ec4
2 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,12 @@ fixed<INT, FRAC>::to_integral (void) const
{ return m_value >> FRAC; }
template <unsigned int INT, unsigned int FRAC>
typename fixed<INT, FRAC>::combined_type
fixed<INT, FRAC>::to_native (void) const
{ return m_value; }
/*
* Integral operators
*/

View File

@ -41,6 +41,7 @@ namespace util {
double to_double (void) const;
float to_float (void) const;
integral_type to_integral (void) const;
combined_type to_native (void) const;
fixed<INT, FRAC>& operator +=(const fixed<INT, FRAC>);
fixed<INT, FRAC>& operator -=(const fixed<INT, FRAC>);