Returns %T or %F Use: isprime(arg). arg is integer >=0
Returns 1 if true, 0 if not Use: isprime(arg). arg is integer >=0 thanks to Allan CORNET for show me how to improve performance of this function
Upload date : 2012-04-16 21:16:36 MD5 : c57f81aaa7e065093e6c60487c9b850c SHA1 : 4bb66ed3b73a3148a749d795f52d053348061b28 Downloads : 1977
Hi, A faster and easier way is: function r = isprime(number) p = factor(number); r = (size(p, '*') == 1); endfunction Thanks Allan
thanks for the tip. I'm new with scilab and i need to learn. I appreciate your comment JF