[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-433-g89e5f75

Benoit Sonntag sonntag at icps.u-strasbg.fr
Fri Aug 21 16:45:48 UTC 2009


The following commit has been merged in the master branch:
commit 89e5f75663e543a563dcb25bb0676f0d0be62f9c
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date:   Fri Aug 21 18:45:47 2009 +0200

    is_prime OK

diff --git a/lib/number/integer.li b/lib/number/integer.li
index a55e6b6..c4caab4 100644
--- a/lib/number/integer.li
+++ b/lib/number/integer.li
@@ -312,13 +312,12 @@ Section Public
     + sqrt_s : INTEGER;
     + result : BOOLEAN;
 
-    sqrt_s := Self.sqrt;
-    ((Self % 2 = 0) && {Self % 3 = 0}).if_false {
-    result := TRUE;
-    1.to ((sqrt_s+1)/6) until {(Self % diviseur) = 0} do { cpt : INTEGER;
-        diviseur := 6*cpt - ((cpt & 1) << 1) + 1;
-          };
-     result := (diviseur.in_range (sqrt_s -6) to (sqrt_s+6));
+    sqrt_s := sqrt;
+    ((Self % 2 != 0) || {Self % 3 != 0}).if {
+      1.to ((sqrt_s+1)/6) until {(Self % diviseur) = 0} do { cpt : INTEGER;
+        diviseur := 6 * cpt - ((cpt & 1) << 1) + 1;
+      };
+      result := diviseur.in_range (sqrt_s - 6) to (sqrt_s + 6);
     };
     result
   );
diff --git a/src/lisaac.li b/src/lisaac.li
index 5fbef9f..b195518 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -32,7 +32,7 @@ Section Header
   // Top 5 memory record :
   // 1 - LOCAL         (>20MB) (il fo Aliaser les tmp !)
   // 2 - READ_LOCAL    (15MB)
-  // 3 - LIST          (13MB) (En baisse => a retester!!)
+  // 3 - LIST          (13MB) (En baisse => a retester.)
   // 4 - PROTOTYPE_CST (10MB)
   // 5 - WRITE_LOCAL   (10MB)
   

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list