math.primes.safe: this looks nicer.

char-rename
John Benediktsson 2017-02-08 11:32:34 -08:00
parent a8b66764d5
commit 119ba84998
1 changed files with 1 additions and 4 deletions

View File

@ -16,10 +16,7 @@ IN: math.primes.safe
PRIVATE>
: safe-prime? ( q -- ? )
{
[ dup odd? [ 1 - 2 / prime? ] [ drop f ] if ]
[ prime? ]
} 1&& ;
{ [ prime? ] [ 1 - 2 / prime? ] } 1&& ;
: next-safe-prime ( n -- q )
next-safe-prime-candidate