[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-437-g37ee783
ontologiae
ontologiae at ordinateur-de-ontologiae.local
Sun Aug 23 17:20:25 UTC 2009
The following commit has been merged in the master branch:
commit 37ee7831f4ef946fdd5388b9e693328a6b87a2ff
Author: ontologiae <ontologiae at ordinateur-de-ontologiae.local>
Date: Sun Aug 23 19:19:50 2009 +0200
is_prime ok and washed
diff --git a/lib/number/integer.li b/lib/number/integer.li
index c52e997..2433fe7 100644
--- a/lib/number/integer.li
+++ b/lib/number/integer.li
@@ -311,17 +311,11 @@ Section Public
( + diviseur : INTEGER;
+ sqrt_s : INTEGER;
+ result : BOOLEAN;
- //"debut test primalité".println;
diviseur := 5;
- sqrt_s := Self.sqrt;
- result := FALSE;
+ sqrt_s := sqrt;
((Self % 2 = 0) || {Self % 3 = 0}).if_false {
- result := TRUE;
- //sqrt_s.println;"--".println;
1.to sqrt_s until {(Self % diviseur) = 0} do { cpt : INTEGER;
- //"Boucle: cpt,diviseur = ".print;((cpt-1) & 1).println;
diviseur := diviseur + 2 + (((cpt-1) & 1) << 1);
- //diviseur.println;
};
result := result && {!((Self % diviseur) = 0)};
};
--
Lisaac compiler
More information about the Lisaac-commits
mailing list