octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Expecting errors,warnings


From: michele
Subject: Re: Expecting errors,warnings
Date: Fri, 23 Mar 2018 09:40:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/23/2018 08:48 AM, Dildar Sk wrote:
When I type,
list_primes (-10)
ans = [](0x0)
primes(-20)
ans = [](1x0)
Isn't it valid to produce error, warning instead of giving a empty vector in
case of negative numbers input?



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html


I think is done for Matlab compatibility: Matlab2017b doesn't have the function list_primes, however

>> primes(-20)

ans =

  1×0 empty double row vector

So I suppose that list_primes does not give error for coherence with primes (even if maybe it should still be a 1x0 vector instead of a 0x0)

--
Michele Ginesi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]