Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
import "/big" for BigInt
|
||||
|
||||
var iters = 10
|
||||
// find all primes < 100
|
||||
System.print("The following numbers less than 100 are prime:")
|
||||
System.write("2 ")
|
||||
for (i in 3..99) {
|
||||
if (BigInt.new(i).isProbablePrime(iters)) System.write("%(i) ")
|
||||
}
|
||||
System.print("\n")
|
||||
var bia = [
|
||||
BigInt.new("4547337172376300111955330758342147474062293202868155909489"),
|
||||
BigInt.new("4547337172376300111955330758342147474062293202868155909393")
|
||||
]
|
||||
for (bi in bia) {
|
||||
System.print("%(bi) is %(bi.isProbablePrime(iters) ? "probably prime" : "composite")")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue