spielwiese
Last change
on this file since cc2b49 was
cc2b49,
checked in by Rüdiger Stobbe <stobbe@…>, 28 years ago
|
"smallprimes and bigprimes are now stored in cf_primetab.h.
minor changes in all functions.
"
git-svn-id: file:///usr/local/Singular/svn/trunk@25 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | // emacs edit mode for this file is -*- C++ -*- |
---|
2 | // $Id: cf_primes.cc,v 1.3 1996-06-18 12:14:37 stobbe Exp $ |
---|
3 | |
---|
4 | /* |
---|
5 | $Log: not supported by cvs2svn $ |
---|
6 | Revision 1.2 1996/06/18 06:53:42 stobbe |
---|
7 | "Now stores more prime numbers. |
---|
8 | " |
---|
9 | |
---|
10 | Revision 1.1 1996/06/03 08:34:35 stobbe |
---|
11 | "Now stores the first 3500 primes counted from 3. |
---|
12 | cf_getBigPrime: gives primes in reversed order. |
---|
13 | " |
---|
14 | |
---|
15 | Revision 1.0 1996/05/17 10:59:44 stobbe |
---|
16 | Initial revision |
---|
17 | |
---|
18 | */ |
---|
19 | |
---|
20 | #include "assert.h" |
---|
21 | #include "cf_defs.h" |
---|
22 | #include "cf_globals.h" |
---|
23 | #include "cf_primes.h" |
---|
24 | #include "cf_primetab.h" |
---|
25 | |
---|
26 | |
---|
27 | int cf_getPrime( int i ) |
---|
28 | { |
---|
29 | ASSERT( i >= 0 && i < NUMPRIMES, "index to primes too high" ); |
---|
30 | if ( i >= NUMSMALLPRIMES ) |
---|
31 | return bigprimes[i-NUMSMALLPRIMES]; |
---|
32 | else |
---|
33 | return smallprimes[i]; |
---|
34 | } |
---|
35 | |
---|
36 | int cf_getNumPrimes() |
---|
37 | { |
---|
38 | return NUMPRIMES; |
---|
39 | } |
---|
40 | |
---|
41 | int cf_getSmallPrime( int i ) |
---|
42 | { |
---|
43 | ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" ); |
---|
44 | return smallprimes[i]; |
---|
45 | } |
---|
46 | |
---|
47 | int cf_getNumSmallPrimes() |
---|
48 | { |
---|
49 | return NUMSMALLPRIMES; |
---|
50 | } |
---|
51 | |
---|
52 | int cf_getBigPrime( int i ) |
---|
53 | { |
---|
54 | ASSERT( i >= 0 && i < NUMBIGPRIMES, "index to primes too high" ); |
---|
55 | return bigprimes[i]; |
---|
56 | } |
---|
57 | |
---|
58 | int cf_getNumBigPrimes() |
---|
59 | { |
---|
60 | return NUMBIGPRIMES; |
---|
61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.