[Libprime-devel-cvs] CVS: libprime/src/tests/prime-inc Makefile.in,NONE,1.1 prime-increment.cpp,NONE
Status: Inactive
Brought to you by:
simmo
|
From: Andrew S. <si...@us...> - 2001-12-06 08:57:52
|
Update of /cvsroot/libprime/libprime/src/tests/prime-inc
In directory usw-pr-cvs1:/tmp/cvs-serv25186/src/tests/prime-inc
Added Files:
Makefile.in prime-increment.cpp
Log Message:
big overhaul part two
--- NEW FILE: Makefile.in ---
# libprime
# Copyright (c) 2001 Andrew Simmonds <si...@ii...>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
SUBDIRS =
include $(topsrcdir)/build/autoconf.mk
EXPORT = prime-inc
SOURCES = prime-increment.cpp
OBJECTS = prime-increment.o
LIBS = ../../libprime/libprime.a
INCLUDES = -I../../include
include $(topsrcdir)/build/rules.mk
--- NEW FILE: prime-increment.cpp ---
/*
* libprime
* Copyright (c) 2001 Andrew Simmonds <si...@ii...>
* prime-increment.cpp
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "libprime.h"
using namespace std;
int main(uint argc, char* argv[]) {
if(argc == 1) {
cerr << "Not Enough Parameters\n";
return 0;
}
for(uint i=1; i<strlen(argv[1]); i++) {
if(!isdigit(argv[1][i])) {
cerr << "Not a Number\n";
return 0;
}
}
ulong baseNumber = atol(argv[1]);
NextPrime xPrime(baseNumber);
cout << ++xPrime
<< endl;
return 0;
}
|