Mercurial > hg > octave-lyh
diff src/DLD-FUNCTIONS/det.cc @ 7814:87865ed7405f
Second set of single precision test code and fix of resulting bugs
author | David Bateman <dbateman@free.fr> |
---|---|
date | Mon, 02 Jun 2008 16:57:45 +0200 |
parents | 82be108cc558 |
children | e69bca367ed7 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/det.cc +++ b/src/DLD-FUNCTIONS/det.cc @@ -93,7 +93,7 @@ retval(1) = rcond; volatile float xrcond = rcond; xrcond += 1.0; - retval(0) = ((info == -1 || xrcond == 1.0) ? 0.0 : det.value ()); + retval(0) = ((info == -1 || xrcond == 1.0) ? static_cast<float>(0.0) : det.value ()); } } else if (arg.is_complex_type ()) @@ -110,7 +110,7 @@ volatile float xrcond = rcond; xrcond += 1.0; retval(0) = ((info == -1 || xrcond == 1.0) - ? Complex (0.0) : det.value ()); + ? FloatComplex (0.0) : det.value ()); } } @@ -189,6 +189,16 @@ } /* + +%!assert(det ([1, 2; 3, 4]), -2, 10 * eps); +%!assert(det (single([1, 2; 3, 4])), single(-2), 10 * eps ('single')); +%!error <Invalid call to det.*> det (); +%!error <Invalid call to det.*> det (1, 2); +%!error det ([1, 2; 3, 4; 5, 6]); + +*/ + +/* ;;; Local Variables: *** ;;; mode: C++ *** ;;; End: ***