[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comparison with NaN
From: |
Jaroslav Hajek |
Subject: |
Re: Comparison with NaN |
Date: |
Mon, 11 May 2009 07:35:17 +0200 |
On Sun, May 10, 2009 at 10:43 PM, Michael Goffioul
<address@hidden> wrote:
> Hi,
>
> After running the test suite, I get a couple of errors. All of these
> seem to be related to comparing/sorting with NaN. For instance:
>
> assert (sort ([NaN, 1, -1, 2, Inf], 2),[-1, 1, 2, Inf, NaN]) expected
> -1 1 2 Inf NaN
> but got
> NaN -1 1 2 Inf
>
> Can anybody tell me what is the expected behavior?
>
The assertion result indicates the expected behavior. I can't
reproduce the problem. Hmmm. Can you try the attached test patch and
tell me whether the message gets printed after running `sort ([NaN, 1,
-1, 2, Inf], 2)' ? (it will be only printed once, so if you have some
startup scripts calling sort with doubles, it should get printed
earlier).
Plus, please tell me the status of HAVE_CMATH_ISNAN in your config.h.
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
diff --git a/liboctave/Array-d.cc b/liboctave/Array-d.cc
--- a/liboctave/Array-d.cc
+++ b/liboctave/Array-d.cc
@@ -40,6 +40,12 @@
inline bool
sort_isnan<double> (double x)
{
+ static bool first_time = true;
+ if (first_time)
+ {
+ std::cerr << "sort_isnan<double> correctly specialized.\n";
+ first_time = false;
+ }
return xisnan (x);
}
- Comparison with NaN, Michael Goffioul, 2009/05/10
- Re: Comparison with NaN,
Jaroslav Hajek <=
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Jaroslav Hajek, 2009/05/11
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Jaroslav Hajek, 2009/05/11
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Jaroslav Hajek, 2009/05/11
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Michael Goffioul, 2009/05/11
- Re: Comparison with NaN, Jaroslav Hajek, 2009/05/14