diff --git a/liboctave/util/oct-inttypes.h b/liboctave/util/oct-inttypes.h --- a/liboctave/util/oct-inttypes.h +++ b/liboctave/util/oct-inttypes.h @@ -28,6 +28,8 @@ #include #include +#include +#include #include "lo-traits.h" #include "lo-math.h" @@ -251,10 +253,17 @@ } else if (chk_max::op (value, static_cast (max_val ()))) { + std::cerr << "value: " << std::setprecision (20) << value + << " max_val: " << std::setprecision (20) + << static_cast (max_val ()) << std::endl; + std::cerr << "maxing out!" << std::endl; return max_val (); } else - return static_cast (value); + { + std::cerr << "casting" << std::endl; + return static_cast (value); + } } private: @@ -293,11 +302,16 @@ } else if (value > thmax) { + std::cerr << "value: " << std::setprecision (20) << value << std::endl; + std::cerr << "thmax: " << std::setprecision (20) << thmax << std::endl; return max_val (); } else { + std::cerr << "value: " << std::setprecision (20) << value << std::endl; S rvalue = xround (value); + std::cerr << "rvalue: " << std::setprecision (20) << rvalue << std::endl; + std::cerr << "cast value: " << std::setprecision (20) << static_cast (rvalue) << std::endl; return static_cast (rvalue); } } @@ -994,7 +1008,15 @@ template <> \ inline octave_int64 \ operator OP (const octave_int64& x, const double& y) \ - { return octave_int64 (static_cast (x.value ()) OP y); } \ + { \ + long double tx = static_cast (x.value ());\ +long double tr = tx OP y; \ + std::cerr << "op: " << #OP << std::endl; \ + std::cerr << "tx: " << std::setprecision (20) << tx << std::endl; \ + std::cerr << "y: " << std::setprecision (20) << y << std::endl; \ + std::cerr << "tr: " << std::setprecision (20) << tr << std::endl; \ +return octave_int64 (static_cast (x.value ()) OP y); \ + } \ template <> \ inline octave_uint64 \ operator OP (const octave_uint64& x, const double& y) \