Mercurial > hg > octave-nkf
comparison scripts/specfun/isprime.m @ 11431:0d9640d755b1
Improve docstrings for all isXXX functions.
Use 'return true' rather than 'return 1'.
Improve the cross-referencing through seealso links.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 31 Dec 2010 13:20:44 -0800 |
parents | faff5367cc05 |
children | c776f063fefe |
comparison
equal
deleted
inserted
replaced
11430:6374938b3b36 | 11431:0d9640d755b1 |
---|---|
16 ## You should have received a copy of the GNU General Public License | 16 ## You should have received a copy of the GNU General Public License |
17 ## along with Octave; see the file COPYING. If not, see | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | 18 ## <http://www.gnu.org/licenses/>. |
19 | 19 |
20 ## -*- texinfo -*- | 20 ## -*- texinfo -*- |
21 ## @deftypefn {Function File} {} isprime (@var{n}) | 21 ## @deftypefn {Function File} {} isprime (@var{x}) |
22 ## Return true if @var{n} is a prime number, false otherwise. | 22 ## Return a logical array which is true where the elements of @var{x} are |
23 ## prime numbers and false where they are not. | |
23 ## | 24 ## |
24 ## If max(n) is very large, then you should be using special purpose | 25 ## If the maximum value in @var{x} is very large, then you should be using |
25 ## factorization code. | 26 ## special purpose factorization code. |
26 ## | 27 ## |
28 ## @example | |
29 ## @group | |
30 ## isprime (1:6) | |
31 ## @result{} [0, 1, 1, 0, 1, 0] | |
32 ## @end group | |
33 ## @end example | |
27 ## @seealso{primes, factor, gcd, lcm} | 34 ## @seealso{primes, factor, gcd, lcm} |
28 ## @end deftypefn | 35 ## @end deftypefn |
29 | 36 |
30 function t = isprime (n) | 37 function t = isprime (n) |
31 | 38 |