Hello!
I have been doing some research to see if C++ has some sort of
function to work with prime numbers.
For example, I would like to input integers and have the program check
to see if the integers are prime numbers.
I have been unsuccessful in finding anything. I am sure I can probably
figure out a long way to do it, but I was curious to see if C++ had
something available.
Thanks!
Chris 4 11511
"Chris" <de*****@verizo n.net> wrote... I have been doing some research to see if C++ has some sort of function to work with prime numbers.
For example, I would like to input integers and have the program check to see if the integers are prime numbers.
I have been unsuccessful in finding anything. I am sure I can probably figure out a long way to do it, but I was curious to see if C++ had something available.
The Standard library does NOT have such a function. If it did,
all those seekers of the largest number would have nothing to
do, would they?
Try www.google.com.
Victor
In article <2e************ *************@p osting.google.c om>, de*****@verizon .net says... Hello!
I have been doing some research to see if C++ has some sort of function to work with prime numbers.
None that's particular to prime numbers, and not really much that's any
more than a buildingblock toward working with large numbers in general.
For example, I would like to input integers and have the program check to see if the integers are prime numbers.
Depending on how big of numbers you want to deal with, that's anywhere
from trivial (e.g. < 20 digits) to a massive project (e.g. the General
Number Field Sieve is one of the most complex algorithms ever devised by
man).
I have been unsuccessful in finding anything. I am sure I can probably figure out a long way to do it, but I was curious to see if C++ had something available.
The MIRACL library has quite a nice factoring program as a free demo of
its capabilities. You can get the library (with the demo) from: ftp://ftp.computing.dcu.ie/pub/crypto/miracl.zip

Later,
Jerry.
The universe is a figment of its own imagination.
"Jerry Coffin" <jc*****@taeus. com> wrote in message
news:MP******** *************** *@news.clspco.a delphia.net... In article <2e************ *************@p osting.google.c om>, de*****@verizon .net says... Hello!
I have been doing some research to see if C++ has some sort of function to work with prime numbers.
None that's particular to prime numbers, and not really much that's any more than a buildingblock toward working with large numbers in general.
For example, I would like to input integers and have the program check to see if the integers are prime numbers.
Depending on how big of numbers you want to deal with, that's anywhere from trivial (e.g. < 20 digits) to a massive project (e.g. the General Number Field Sieve is one of the most complex algorithms ever devised by man).
I have been unsuccessful in finding anything. I am sure I can probably figure out a long way to do it, but I was curious to see if C++ had something available.
The MIRACL library has quite a nice factoring program as a free demo of its capabilities. You can get the library (with the demo) from: ftp://ftp.computing.dcu.ie/pub/crypto/miracl.zip
 Later, Jerry.
Not to forget the nice "Miller Rabin probabilistic primality" test, which
IMHO is just a piece of art.
Cheers
Chris Not to forget the nice "Miller Rabin probabilistic primality" test, which IMHO is just a piece of art.
Yes.
Rabin's work was based on randomized algorithms.
It shows how sometimes randomized algorithms solve problems much more easily
over their deterministic counterparts. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics 
by: Dag 
last post by:
Is there a python module that includes functions for working with prime
numbers? I mainly need A function that returns the Nth prime number and
that returns how many prime numbers are less than N, but a prime number
tester would also be nice. I'm dealing with numbers in the 10^610^8 range
so it would have to fairly efficient
Dag

by: Greg Brunet 
last post by:
In doing some testing of different but simple algorithms for getting a
list of prime numbers, I ended up getting some results that seem a bit
contradictory. Given the following test program (testPrimes.py) with
two algorithms that both check for primes by testing only odd numbers
using factors up to the square root of the value, where Primes1 is based
on all of the existing primes so far, and Primes2 is based on all odd
numbers, I would...

by: don 
last post by:
Ok, this is a homework assignment, but can you help me out anyway...... I
need a routine for figuring out if a number inputted by the user is a prime
number or not...... all I'm asking for is Not the exact code ( well maybe a
little) but the logic or algorithm to tell whether or not a number is
prime....

by: AshifToday 
last post by:
this was my and my frineds little project in earlier classes,
the program seperates the composite and prime numbers in two sections
of the screen
=====================
/*
This program has been made by A & A Group.
Muhammad Ali: Roll # 1462 Class A2 , B.Sc.(Hons.) in C.S.

by: ETM11871 
last post by:
i need to develop a code that finds a prime right number between 2 and 100000. and print one line of text that indicates if the int. is right prime. i am in beginning programing so complex is complicated. we are on a functions chapter. i am usung the square root to find the prime. so far i have accomplished this but i cant fgure how to divide this by ten so i can find the right prime. i am using c.
#include <stdio.h>
#include <math.h>
...
 
by: johnmsimon 
last post by:
i need to develop a code that finds a prime right number between 2 and
100000. and print one line of text that indicates if the int. is right
prime. i am in beginning programing so complex is complicated. we are
on a functions chapter. i am usung the square root to find the prime.
so far i have accomplished this but i cant fgure how to divide this by
ten so i can find the right prime. i am using c.
#include <stdio.h>

by: rhle.freak 
last post by:
Here is my code to generate prime numbers.It works absolutely fine when
the range is
*not very large*. However on initializing i with a large integer it
produces erroneous results
(some numbers ending in 5 ..which obviously cannot be prime numbers)
can anyone please help me out with the reason??
/*Generate Prime Numbers*/
#include<stdio.h>

by: newstips6706 
last post by:
1, 2, 3, 5, 7... PRIME Numbers
________________________________
Definitions
What is a PRIME Number ?

by: Caffiend 
last post by:
Well, I've been picking at learning python, got tired of reading, and figured I'd try to replicate my prime number generator I wrote (with much TSDN forum help) in C++. I've hit a stumbling block... the program is supposed to print onscreen all the prime numbers between two numbers given to it, so if I put in 1 and 10, it should print out 1, 3, 5, 7 (I know, technically 1 isn't considered prime, and 2 should be on there, but otherwise...) ...

by: jinu1996 
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...

by: Hystou 
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
 
by: tracyyun 
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, ZWave, WiFi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...

by: agi2029 
last post by:
Let's talk about the concept of autonomous AI software engineers and nocode agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...

by: isladogs 
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...

by: conductexam 
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...

by: 6302768590 
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

by: muto222 
last post by:
How can i add a mobile payment intergratation into php mysql website.
 
by: bsmnconsultancy 
last post by:
In today's digital era, a welldesigned website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
 