[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #43041] isprime(5i) returns true
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #43041] isprime(5i) returns true |
Date: |
Sun, 24 Aug 2014 00:27:49 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 |
Follow-up Comment #4, bug #43041 (project octave):
Is it correct to return
isprime (abs (x))
when x is real and less than 0? Every web source defines a real-valued prime
on the positive integer range [1, Inf]. As an example,
http://mathworld.wolfram.com/PrimeNumber.html.
It seems to be more appropriate to issue an error in this case. Or, if the
calculation should proceed then to issue NaN since it is not definitionally a
prime number, even if it meets the test for being a prime.
In this case, -5, looks like a duck, quacks like a duck, but is excluded by
definition from actually being a duck.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?43041>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/