[scilab-Users] I think I have found a bug - an "incomparable" number.

StŽéphane Mottelet stephane.mottelet at utc.fr
Mon Mar 15 13:55:35 CET 2010


leszek.luchowski at iitis.gliwice.pl a écrit :
> Hi. I ran into a strange problem in Scilab. My program crashed, and I
> couldn't find an error in it. Apparently, there isn't any! I managed to
> isolate the problem by cutting off most of my code and just leaving this:
>
> // ===================================
> clear;
> clc;
>
> A=[1 0 0 0;
> 0 0 3 0;
> 0 2 0 0;
> 0 0 0 1];
>
> sx=spec(A)
> if sx(1)>0.0 // <--- This is where it crashes!
> "Positive"
> end
> // ===================================
>
> The value of sx(1) is an unimpressive real number, about 2.45. Why can't I
> compare it to zero?
>
> Thanks in advance for any enlightment,
> Leszek.
>
> As this is my first post in this list i wish to say hello to everybody.
>   

sx=spec(A)
if real(sx(1))>0.0 
"Positive"
end


there are some spurious imaginary parts, likely.

S.




More information about the users mailing list