help-octave
[Top][All Lists]
Advanced

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

Re: Error in compilint .oct file Complex and octave_value


From: Jaroslav Hajek
Subject: Re: Error in compilint .oct file Complex and octave_value
Date: Fri, 19 Sep 2008 12:40:43 +0200

On Fri, Sep 19, 2008 at 12:17 PM, pauljoseph <address@hidden> wrote:
>
>
>
> pauljoseph wrote:
>>
>>
>> ----
>> error: no matching function for call to 'acos(octave_value)'
>> /usr/include/bits/mathcalls.h:55: note: candidates are: double
>> acos(double)
>> /home/kurniawano/Programs/Octave3.0.1/include/octave-3.0.1/octave/lo-mappers.h:49:
>> note:                 Complex acos(const Complex&)
>> ----
>>
>> The error seems to be caused by this line
>> ka=acos(1-(egrid(loopE)+eta-Ec(0))*0.5/t0); // This is the part that
>> causes error
>>
>> The strange thing is that if I omit the '1' in front, it gives me no
>> error.
>> ka=acos((egrid(loopE)+eta-Ec(0))*0.5/t0);
>>
>>
>
> Just an update. I found out if I replace 1 with 1.0 it does not give any
> error. Is this a bug?
> ka=acos(1.0-(egrid(loopE)+eta-Ec(0))*0.5/t0); //This works ok
> --

Mixing integers and double complex numbers (std::complex<double>) in
C++ is not defined - try it. That's why the 2nd version works and the
1st doesn't. I'm not sure why is the compiler trying to promote
operands to octave_value; maybe the standard says that it should do if
there is only one common convertible type.


> View this message in context: 
> http://www.nabble.com/Error-in-compilint-.oct-file-Complex-and-octave_value-tp19569309p19569755.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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