projects
/
cfuerst
/
formal-numbers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
072cd08
)
optimized algorithm
author
Christoph Fuerst
<ch.fuerst@gmx.at>
Fri, 14 Apr 2017 16:36:05 +0000
(18:36 +0200)
committer
Christoph Fuerst
<ch.fuerst@gmx.at>
Fri, 14 Apr 2017 16:36:05 +0000
(18:36 +0200)
sieveEratosthenes.txt
patch
|
blob
|
history
diff --git
a/sieveEratosthenes.txt
b/sieveEratosthenes.txt
index
4790088
..
0ae53d4
100644
(file)
--- a/
sieveEratosthenes.txt
+++ b/
sieveEratosthenes.txt
@@
-40,10
+40,9
@@
proc SieveOfErathostenes(m:nat): Array[MAX,Bool]
{
if ret[i] = true then
{
- j = i^2;
for k=0;i^2+k*i<MAX;k=k+1 do
{
-
j=i^2+k*i;
+ j=i^2+k*i;
ret[j] = false;
}
}
@@
-82,3
+81,4
@@
proc SieveOfErathostenesSet(m:ℕ[MAX]): Set[ℕ[MAX]]
return ret;
}
+