mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2022-03-10, 19:49   #1
Harklo73
 
Jan 2022

2×32 Posts
Default Made a program to test any number with NTL library

Hello everyone,
I made a program to test any number for primality.
It performs a Fermat test and a Miller Rabbin test.
The program uses the NTL library and the GMP library and is just two pages long.
The Linux version is much faster than the Windows version.
Can I post it?
Harklo73 is offline   Reply With Quote
Old 2022-03-10, 19:54   #2
firejuggler
 
firejuggler's Avatar
 
"Vincent"
Apr 2010
Over the rainbow

19·151 Posts
Default

Sure you can. If you can provide source, some other might offer input on how to implement it faster.

Last fiddled with by firejuggler on 2022-03-10 at 19:54
firejuggler is offline   Reply With Quote
Old 2022-03-10, 20:05   #3
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

2×47×59 Posts
Default

We don't welcome black-box executables around here, but you're welcome to post source.
VBCurtis is offline   Reply With Quote
Old 2022-03-10, 20:52   #4
Harklo73
 
Jan 2022

228 Posts
Default here is the source code

Herei is the source code a promisedPrime.cpp
Harklo73 is offline   Reply With Quote
Old 2022-03-10, 21:17   #5
Harklo73
 
Jan 2022

2×32 Posts
Smile There is a little bug in the windows version of NTL but I solved it.

If you get an error compiling the windows 32 bit version of NTL in the file lips.h, change the line where the error is that complains about long unsigned to long long, then it compiles well.
Harklo73 is offline   Reply With Quote
Old 2022-03-10, 21:36   #6
Harklo73
 
Jan 2022

2·32 Posts
Smile This is how to compile:

Compile this file with:
gcc -o Prime Prime.cpp -lntl -lgmp -lstdc++ -lm -lpthread
Harklo73 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a bigger number to test ? mersenne1588 Information & Answers 6 2019-02-12 22:13
Shift Number in LL Test Kalli Hofmann Information & Answers 1 2018-01-08 12:24
Just for fun! I made a program which can recover assignment ID dabaichi PrimeNet 8 2011-12-28 01:07
Program - primes between number/range Unregistered Software 2 2006-08-22 22:54
New program to test a single factor dsouza123 Programming 6 2004-01-13 03:53

All times are UTC. The time now is 16:41.


Sat Nov 26 16:41:31 UTC 2022 up 100 days, 14:10, 1 user, load averages: 0.94, 1.09, 1.08

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔