Using a better algorithm based on property of primes.

I recently found out that `p` being prime, while `p > 3`, then
`p = 6*k (+/-) 1`.
This commit is contained in:
Nicolás Ortega Froysa
2019-10-08 17:58:08 +02:00
parent 2cfc24afb7
commit 84687f86c1
4 changed files with 84 additions and 22 deletions

View File

@ -22,7 +22,7 @@ LDFLAGS=-lgmp
DEFS=-DVERSION=\"2.0\" -DAPP_NAME=\"Indivisible\"
CFLAGS=$(INCFLAGS) $(DEFS) -std=c99 -Wall -Wextra -Wfatal-errors -Werror
HDRS=src/globals.h src/llist.h
OBJS=src/main.o src/llist.o
OBJS=src/llist.o src/main.o src/prime_test.o
ifeq ($(DEBUG),1)
CFLAGS+=-g -O0 -DDEBUG