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

Samuel Gougeon sgougeon at free.fr
Thu Oct 1 22:20:00 CEST 2015


Le 01/10/2015 22:06, Samuel Gougeon a écrit :
>> .../...
>>
>> 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.
>> .../..
>
> 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
.
Actually, even if |start| is inf, returning start (so +/-inf) would be 
relevant.
Updated proposal:
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|stop| ~= inf  && |step|==inf => return start (even if it is +-inf)
f) if start or stop or both are inf or -inf => error, even when |step| 
is inf
g) otherwise: normal computation.

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20151001/6afed123/attachment.htm>


More information about the dev mailing list