I am struggling to get an appropriate return for this operator (it is not my code, just trying to correct it and I am not as good as I should be in C++ to correct it) can anybody help me with this, it is datatype class defined for high level design of digital circuits.
How to return this temp
without an error, is there any special approach to this?
inline friend std::ostream& operator << ( std::ostream& os, const sc_float &v)
{
if (c_DEBUG) std::cout << "debug: operator << called " << endl; //debug
// fixme - this is only copy of sc_float2double function
double temp;
temp = (double)v.man / exp2(m_width);
temp += 1.0;
temp *= exp2((double)v.exp - exp2((double)e_width - 1.0) + 1.0);
temp *= (v.sign == true ? -1.0 : 1.0);
//os << "(" << v.sign << " , " << v.exp << " , " << v.man << ")"; // debug
os << temp;
}
as I add there return os;
I got 226 errors which points to systemC library and instances there. Has anybody done declaration of stream operator with regards to systemC classes or have anybody idea how it is done?