octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cast ambiguity compilation error


From: Daniel J Sebald
Subject: Re: Cast ambiguity compilation error
Date: Tue, 20 Jan 2009 01:58:23 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:

| diff -Pur octave/liboctave/intNDArray.cc octave-mod/liboctave/intNDArray.cc
| --- octave/liboctave/intNDArray.cc    2009-01-18 13:45:08.000000000 -0600
| +++ octave-mod/liboctave/intNDArray.cc        2009-01-18 13:53:19.000000000 
-0600
| @@ -53,7 +53,7 @@
|      {
|        T val = this->elem (i);
| | - if (((double)val) != 0.0 && ((double)val) != 1.0)
| +      if (val != 0.0 && val != 1.0)
|       return true;
|      }

Your diff seems to be reversed.

Yes, it should be the other way.


Would it work to use

  if (val != 0 && val != 1)

instead?

That doesn't fix the problem.  It's the compiler.  It does seem like 0/1 is 
more general than 0.0 and 1.0, however.  1.0 suggests float.  Apparently it 
doesn't matter.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]