[Scilab-users] type/typeof bug ?

philippe rouxph.22 at gmail.com
Tue Jun 7 09:03:54 CEST 2016


hi,

I work with matrix of polynomials, but some coefficients could be
scalar. I though that I could differentiate real and polynomial
coefficients comparing their type, surprisingly  type(A(i,j))=2
whatever the nature of A(i,j)  (see example below). Is this a bug ? For
my applications i have a "work around "  comparing their degree .

Philippe

8<---8<---8<---8<-- example  8<--8<---8<---8<---8<---

-->X=poly(0,'x') // a polynomial
 X  =

    x

-->type(X)       // =2 polynomial
 ans  =

    2.

-->L=[X 0 1]     // a matrix
 L  =

    x     0    1

-->type(L)       // =2 polynomial
 ans  =

    2.

-->a=L(2)        // a real
 a  =

    0

-->type(a)       // = 2 ????
 ans  =

    2.

-->varn(a)
 ans  =

 x

-->degree(a)
 ans  =

    0.
8<---8<---8<---8<---8<--8<---8<---8<---8<---




More information about the users mailing list