[Scilab-Dev] Input requested on a few behaviors for Scilab 6...

Samuel Gougeon sgougeon at free.fr
Thu Oct 1 22:06:52 CEST 2015


Hello François,

Thanks for calling for comments:

Le 01/10/2015 18:37, François Granade a écrit :
> .../...
> 1. set ieee(2) by default instead of ieee(0)
+1: http://bugzilla.scilab.org/11527

> .../...
> 2. Make operations with the empty matrix more consistent
* Discussion also @ http://bugzilla.scilab.org/12661
* See also: http://bugzilla.scilab.org/2432

> .../...
>
> 3. Clarify "a:b:c" ranges when one of a, b or c is infinite (%inf) or Not a Number (%nan); or when b is 0.
> --------------
>
> Currently there are many inconsistencies in some cases, for example:
>
> -%inf:1:%inf // returns %nan
> 2:0:5 // return []
> // but:
> %nan:1:5 // returns %nan
>
> In 6.0, we're thinking of fixing things according to the following rules:
>
> i) if start or step or end is %inf or %nan => return []
> ii) step == 0 => return []
> iii) start < end && step < 0 => return []
> iv) start > end && step > 0 => return []
> v) normal computation otherwise

What about this alternative?:
By decreasing priority (read "else" at the end of each line):
a) if stop is %nan => error
b) if start or step is %nan => returns %nan
c) = iii): if start < end && step < 0 => return [], even if start, step 
or stop is/are inf/-inf
d) = iv): if start > end && step > 0 => return [], even if start, step 
or stop is/are inf/-inf
e) if neither |start| nor |stop| are inf, && |step|==inf => return start
f) if start or stop or both are inf or -inf => error, even when |step| 
is inf

HTH
Samuel Gougeon




More information about the dev mailing list