iizukak/julia — pull request #3 by iizukak (2014-10-01 13:24:34+00:00)
Title: add BigInt tests on isprime

For `BigInt` integers, `isprime` function use GMP's `__gmpz_probab_prime_p`. It's should be tested.

`isprime` is enough fast. Adding this tests are small cost.

`280671392065546467397265294532969672241810318954163887187279320454220348884327`
is a composite number and
`6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151`
is a [Mersenne Prime](http://en.wikipedia.org/wiki/Mersenne_prime).

```
julia> typeof(280671392065546467397265294532969672241810318954163887187279320454220348884327)
BigInt (constructor with 10 methods)

julia> @time isprime(280671392065546467397265294532969672241810318954163887187279320454220348884327)
elapsed time: 0.000871627 seconds (13880 bytes allocated)
false

julia> typeof(6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151)
BigInt (constructor with 10 methods)

julia> @time isprime(6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151)
elapsed time: 0.00726637 seconds (2584 bytes allocated)
true
```