ISPR Matlab script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: ispr.m
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Matlab
  • Price:Freeware
  • Company: Michael Kleder (View more)

ISPR script description:




Publisher review:
ISPR - Use a Java to rapidly determine whether an arbitrarily large positive integer is a prime ISPR - Rapidly determine whether an arbitrarily large positive integer is a probable prime.USAGE: q = ispr(n)q = ispn(n,1)n = positive integer, either as a numeric or string datatypeq = 1 if n is prime, 0 if n is composite1 = any second input will cause the function to output a message describing the result in plain language, including (if n is probably prime) a statement about the certainty with which n is claimed to be prime.Notes: Probable primes are also known as "industrial strength" primes because of the exceedlingly high probability -- but not certainty -- of primality. This function utilizes the Java class "BigInteger" with its method"isProbablePrime."For small integers, you can use numeric inputs; however, for abitrarily large integers, you must input the number as a string in order to avoid an overflow. Note the overflow error in the second to last example below.Examples:>>ispr(314159,1)I believe that 314159 is prime, but there is a 1 in 590295810358705650000 chance that I am mistaken.>>ispr('338327950288419716939',1)I believe that 338327950288419716939 is prime, but there is a 1 in 64613997892457940000000000000000000 chance that I am mistaken.>>ispr(338327950288419716939,1)338327950288419680000 is definitely not prime.>> for i=1:1000;if ispr(i);fprintf('%i ',i);end;end;fprintf('')Michael Kleder, September 2004
ISPR is a Matlab script for Mathematics scripts design by Michael Kleder. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5