[scilab-Users] Difference between function return value and literal

Samuel Gougeon Samuel.Gougeon at univ-lemans.fr
Fri Jul 16 14:52:53 CEST 2010


Hello Peter,

Peter von Niederhaeusern <pvonnied at gmail.com> a écrit :

> Hi all,
>
> This might be a silly question, but I don't get it:
>
> // 1. version
> rows=myCell.dims(1);
> disp(rows);  // -> 2
> disp( [1:1:rows] ); // -> 1 2
>
> // 2. version
>  _rows=2;
>  disp(_rows); // -> 2.
>  disp( [1:1:_rows] ); // 1. 2.
>
> What's the difference between the plain values (e.g. 2) of the return value
> and the indexed values with dots (e.g. 2.)?

The dims of a cell array are (weirdly...) coded as integers.
There was recently a thread on Bugzilla about that:
http://bugzilla.scilab.org/show_bug.cgi?id=7371

Numbers stored as integers are displayed without decimal point,
while numbers (even without decimal part) stored as reals
show the point:

a=[ 1 2],typeof(a)
i=uint8(a), typeof(i)

Regards
Samuel




More information about the users mailing list