📄 sc_ufix.h
字号:
// ----------------------------------------------------------------------------// CLASS : sc_ufix_fast//// "Unconstrained" unsigned fixed-point class; limited precision.// ----------------------------------------------------------------------------class sc_ufix_fast : public sc_fxnum_fast{public: // constructors explicit sc_ufix_fast( sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( sc_q_mode, sc_o_mode, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( sc_q_mode, sc_o_mode, int, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int, sc_fxnum_fast_observer* = 0 ); explicit sc_ufix_fast( const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( sc_q_mode, sc_o_mode, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( sc_q_mode, sc_o_mode, int, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( int, int, sc_q_mode, sc_o_mode, int, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 ); explicit sc_ufix_fast( const sc_fxtype_params&, sc_fxnum_fast_observer* = 0 ); sc_ufix_fast( const sc_fxtype_params&, const sc_fxcast_switch&, sc_fxnum_fast_observer* = 0 );#define DECL_CTORS_T(tp) \ sc_ufix_fast( tp, \ int, int, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ sc_q_mode, sc_o_mode, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ sc_q_mode, sc_o_mode, int, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ int, int, sc_q_mode, sc_o_mode, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ int, int, sc_q_mode, sc_o_mode, int, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ int, int, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ sc_q_mode, sc_o_mode, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ sc_q_mode, sc_o_mode, int, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ int, int, sc_q_mode, sc_o_mode, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ int, int, sc_q_mode, sc_o_mode, int, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ const sc_fxtype_params&, \ sc_fxnum_fast_observer* = 0 ); \ sc_ufix_fast( tp, \ const sc_fxtype_params&, \ const sc_fxcast_switch&, \ sc_fxnum_fast_observer* = 0 );#define DECL_CTORS_T_A(tp) \ sc_ufix_fast( tp, \ sc_fxnum_fast_observer* = 0 ); \ DECL_CTORS_T(tp)#define DECL_CTORS_T_B(tp) \ explicit sc_ufix_fast( tp, \ sc_fxnum_fast_observer* = 0 ); \ DECL_CTORS_T(tp) DECL_CTORS_T_A(int) DECL_CTORS_T_A(unsigned int) DECL_CTORS_T_A(long) DECL_CTORS_T_A(unsigned long) DECL_CTORS_T_A(double) DECL_CTORS_T_A(const char*) DECL_CTORS_T_A(const sc_fxval&) DECL_CTORS_T_A(const sc_fxval_fast&) DECL_CTORS_T_A(const sc_fxnum&) DECL_CTORS_T_A(const sc_fxnum_fast&)#ifndef SC_FX_EXCLUDE_OTHER DECL_CTORS_T_B(int64) DECL_CTORS_T_B(uint64) DECL_CTORS_T_B(const sc_int_base&) DECL_CTORS_T_B(const sc_uint_base&) DECL_CTORS_T_B(const sc_signed&) DECL_CTORS_T_B(const sc_unsigned&)#endif#undef DECL_CTORS_T#undef DECL_CTORS_T_A#undef DECL_CTORS_T_B // copy constructor sc_ufix_fast( const sc_ufix_fast& ); // unary bitwise operators const sc_ufix_fast operator ~ () const; // unary bitwise functions friend void b_not( sc_ufix_fast&, const sc_ufix_fast& ); // binary bitwise operators friend const sc_ufix_fast operator & ( const sc_ufix_fast&, const sc_ufix_fast& ); friend const sc_ufix_fast operator ^ ( const sc_ufix_fast&, const sc_ufix_fast& ); friend const sc_ufix_fast operator | ( const sc_ufix_fast&, const sc_ufix_fast& ); // binary bitwise functions friend void b_and( sc_ufix_fast&, const sc_ufix_fast&, const sc_ufix_fast& ); friend void b_or ( sc_ufix_fast&, const sc_ufix_fast&, const sc_ufix_fast& ); friend void b_xor( sc_ufix_fast&, const sc_ufix_fast&, const sc_ufix_fast& ); // assignment operators sc_ufix_fast& operator = ( const sc_ufix_fast& );#define DECL_ASN_OP_T(op,tp) \ sc_ufix_fast& operator op ( tp );#ifndef SC_FX_EXCLUDE_OTHER#define DECL_ASN_OP_OTHER(op) \ DECL_ASN_OP_T(op,int64) \ DECL_ASN_OP_T(op,uint64) \ DECL_ASN_OP_T(op,const sc_int_base&) \ DECL_ASN_OP_T(op,const sc_uint_base&) \ DECL_ASN_OP_T(op,const sc_signed&) \ DECL_ASN_OP_T(op,const sc_unsigned&)#else#define DECL_ASN_OP_OTHER(op)#endif#define DECL_ASN_OP(op) \ DECL_ASN_OP_T(op,int) \ DECL_ASN_OP_T(op,unsigned int) \ DECL_ASN_OP_T(op,long) \ DECL_ASN_OP_T(op,unsigned long) \ DECL_ASN_OP_T(op,double) \ DECL_ASN_OP_T(op,const char*) \ DECL_ASN_OP_T(op,const sc_fxval&) \ DECL_ASN_OP_T(op,const sc_fxval_fast&) \ DECL_ASN_OP_T(op,const sc_fxnum&) \ DECL_ASN_OP_T(op,const sc_fxnum_fast&) \ DECL_ASN_OP_OTHER(op) DECL_ASN_OP(=) DECL_ASN_OP(*=) DECL_ASN_OP(/=) DECL_ASN_OP(+=) DECL_ASN_OP(-=) DECL_ASN_OP_T(<<=,int) DECL_ASN_OP_T(>>=,int) DECL_ASN_OP_T(&=,const sc_ufix&) DECL_ASN_OP_T(&=,const sc_ufix_fast&) DECL_ASN_OP_T(|=,const sc_ufix&) DECL_ASN_OP_T(|=,const sc_ufix_fast&) DECL_ASN_OP_T(^=,const sc_ufix&) DECL_ASN_OP_T(^=,const sc_ufix_fast&)#undef DECL_ASN_OP_T#undef DECL_ASN_OP_OTHER#undef DECL_ASN_OP // auto-increment and auto-decrement const sc_fxval_fast operator ++ ( int ); const sc_fxval_fast operator -- ( int ); sc_ufix_fast& operator ++ (); sc_ufix_fast& operator -- ();};// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII// ----------------------------------------------------------------------------// CLASS : sc_ufix//// "Unconstrained" unsigned fixed-point class; arbitrary precision.// ----------------------------------------------------------------------------// constructorsinlinesc_ufix::sc_ufix( sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params(), SC_US_, sc_fxcast_switch(), observer_ ){}inlinesc_ufix::sc_ufix( int wl_, int iwl_, sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params( wl_, iwl_ ), SC_US_, sc_fxcast_switch(), observer_ ){}inlinesc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om, sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params( qm, om ), SC_US_, sc_fxcast_switch(), observer_ ){}inlinesc_ufix::sc_ufix( sc_q_mode qm, sc_o_mode om, int nb, sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params( qm, om, nb ), SC_US_, sc_fxcast_switch(), observer_ ){}inlinesc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om ), SC_US_, sc_fxcast_switch(), observer_ ){}inlinesc_ufix::sc_ufix( int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, sc_fxnum_observer* observer_ ): sc_fxnum( sc_fxtype_params( wl_, iwl_, qm, om, nb ), SC_US_, sc_fxcast_switch(), observer_ ){}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -