[project @ 2007-04-27 16:36:46 by jwe]
author |
jwe |
date |
Fri, 27 Apr 2007 16:36:46 +0000 |
parents |
55586d763de1 |
children |
65919b012b35 |
files |
liboctave/ChangeLog liboctave/lo-mappers.cc |
diffstat |
2 files changed, 7 insertions(+), 1 deletions(-)
[+]
|
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,7 @@
+2007-04-27 John W. Eaton <jwe@octave.org>
+
+ * lo-mappers.cc (signum (const Complex&)): Special case for (0, 0).
+
2007-04-25 John W. Eaton <jwe@octave.org>
* oct-fftw.h (octave_fftw): Tag with OCTAVE_API.
--- a/liboctave/lo-mappers.cc
+++ b/liboctave/lo-mappers.cc
@@ -273,7 +273,9 @@
Complex
signum (const Complex& x)
{
- return x / abs (x);
+ double tmp = abs (x);
+
+ return tmp == 0 ? 0.0 : x / tmp;
}
// complex -> bool mappers.