-rw-r--r-- | noncore/unsupported/qpdf/fixed.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/fixed.h b/noncore/unsupported/qpdf/fixed.h index ec0e696..44aaa5e 100644 --- a/noncore/unsupported/qpdf/fixed.h +++ b/noncore/unsupported/qpdf/fixed.h @@ -1,35 +1,36 @@ #ifndef __FIXED_H__ #define __FIXED_H__ +#include <stdlib.h> #include <iostream> #define _GCC_TEMPLATE_BUG_ 1 template <unsigned int SH> class fixed { public: inline fixed ( int i = 0 ) : m_f ( i2f( i ) ) { } inline fixed ( double d ) : m_f ( d2f( d )) { } inline fixed ( const fixed &f ) : m_f ( f. m_f ) { } inline operator bool ( ) const { return m_f != 0; } inline operator double ( ) const { return f2d( m_f ); } inline operator float ( ) const { return (float) f2d( m_f ); } inline operator int ( ) const { return (int) f2i( m_f ); } inline fixed &operator = ( const fixed &f ) { m_f = f. m_f; return *this; } inline fixed &operator = ( double d ) { m_f = d2f( d ); return *this; } inline fixed &operator = ( float f ) { m_f = d2f( f ); return *this; } inline fixed &operator = ( int i ) { m_f = i2f( i ); return *this; } inline fixed &operator += ( const fixed &f ) { m_f += f. m_f; return *this; } inline fixed &operator -= ( const fixed &f ) { m_f -= f. m_f; return *this; } inline fixed &operator *= ( const fixed &f ) { m_f = mul ( m_f, f. m_f ); return *this; } inline fixed &operator /= ( const fixed &f ) { m_f = div ( m_f, f. m_f ); return *this; } inline fixed &operator += ( int i ) { m_f += i2f( i ); return *this; } inline fixed &operator -= ( int i ) { m_f -= i2f( i ); return *this; } inline fixed &operator *= ( int i ) { m_f *= i; return *this; } inline fixed &operator /= ( int i ) { m_f /= i; return *this; } inline fixed &operator += ( double d ) { m_f += d2f( d ); return *this; } inline fixed &operator -= ( double d ) { m_f -= d2f( d ); return *this; } |