34 #include <itpp/itexports.h>
40 template<
class Num_T>
class Vec;
41 template<
class Num_T>
class Mat;
54 template<
int, e_mode, o_mode, q_mode>
friend class Fixed;
55 template<
int, e_mode, o_mode, q_mode>
friend class CFixed;
59 :
Fix_Base(s, w, e, o, q, ptr), re(scale_and_apply_modes(x)) {}
62 :
Fix_Base(0, f.wordlen, f.emode, f.omode, f.qmode, f.stat_ptr), re(0) {}
68 :
Fix_Base(x.shift, w, e, o, q, ptr), re(x.re) {}
73 Fix& operator=(
const Fix &x);
75 Fix& operator=(
const int x);
77 Fix& operator+=(
const Fix &x);
79 Fix& operator+=(
const int x);
81 Fix& operator-=(
const Fix &x);
83 Fix& operator-=(
const int x);
85 Fix& operator*=(
const Fix &x);
87 Fix& operator*=(
const int x);
89 Fix& operator/=(
const Fix &x);
91 Fix& operator/=(
const int x);
95 Fix& operator<<=(
const int n);
97 Fix& operator>>=(
const int n);
100 void set(
double x,
int n);
102 void set(
double x,
int n,
q_mode q);
111 void rshift(
int n,
q_mode q);
114 virtual void print()
const;
118 double unfix()
const;
120 #ifndef NO_IMPLICIT_FIX_CONVERSION
122 operator double()
const {
123 it_assert_debug(shift>=-63 && shift <= 64,
"Fix::operator double: Illegal shift!");
146 ITPP_EXPORT std::istream &
operator>>(std::istream &is,
Fix &x);
148 ITPP_EXPORT std::ostream &
operator<<(std::ostream &os,
const Fix &x);
164 #endif // #ifndef FIX_H