Hi all,
I have a (probably naive) C++ question concerning the implementation of
octave_matrix::double_value ().
It is currently written like this:
double
octave_matrix::double_value (bool) const
{
double retval = lo_ieee_nan_value ();
if (is_empty ())
err_invalid_conversion ("real matrix", "real scalar");
warn_implicit_conversion ("Octave:array-to-scalar",
"real matrix", "real scalar");
retval = matrix(0, 0);
return retval;
}
I don't understand the point of initializing retval with the result of
lo_ieee_nan_value (). Would it be correct to simply write:
double
octave_matrix::double_value (bool) const
{
if (is_empty ())
err_invalid_conversion ("real matrix", "real scalar");
warn_implicit_conversion ("Octave:array-to-scalar",
"real matrix", "real scalar");
return matrix (0, 0);
}