From 966c87a14456a017d5150097a6649a42763d1c7b Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Thu, 21 Nov 2024 11:41:43 -0500 Subject: [PATCH] update primes32.tal to new math32.tal --- primes32.tal | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/primes32.tal b/primes32.tal index 9d49237..46c4e34 100644 --- a/primes32.tal +++ b/primes32.tal @@ -43,20 +43,20 @@ ( works for x >= 2 ) @is-prime32 ( x** -> bool^ ) DUP4 ,&x1 STR2 ,&x0 STR2 ( x** ; store x ) - DUP4 #0000 #0002 ne32 ?{ POP4 #01 JMP2r } ( x** ; return if 2 ) + DUP4 #0000 #0002 u32-ne ?{ POP4 #01 JMP2r } ( x** ; return if 2 ) DUP #01 AND ?{ POP4 #00 JMP2r } ( x** ; return if even ) - DUP4 #0000 #0003 ne32 ?{ POP4 #01 JMP2r } ( x** ; return if 3 ) + DUP4 #0000 #0003 u32-ne ?{ POP4 #01 JMP2r } ( x** ; return if 3 ) #0002 ,&inc STR2 ( x** ; inc<-2 ) #0000 #0005 DUP4 ,&i1 STR2 ,&i0 STR2 ( x** i** ; i<-5 ) &loop ( x** i** ) LIT2 [ &x0 $2 ] LIT2 [ &x1 $2 ] ( x** i** x** ) LIT2 [ &i0 $2 ] LIT2 [ &i1 $2 ] ( x** i** x** i** ) - DUP4 mul32 lt32 ( x** i** x