source: git/factory/cf_primes.cc @ e4fe2b

jengelh-datetimespielwiese
Last change on this file since e4fe2b was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
FIX: Fixed huge BUG in cf_gmp.h CHG: starting to cleanup factory
  • Property mode set to 100644
File size: 815 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#include "config.h"
5
6#include "cf_assert.h"
7
8#include "cf_defs.h"
9#include "cf_primes.h"
10#include "cf_primetab.h"
11
12
13int cf_getPrime( int i )
14{
15    ASSERT( i >= 0 && i < NUMPRIMES, "index to primes too high" );
16    if ( i >= NUMSMALLPRIMES )
17        return bigprimes[i-NUMSMALLPRIMES];
18    else
19        return smallprimes[i];
20}
21
22int cf_getNumPrimes()
23{
24    return NUMPRIMES;
25}
26
27int cf_getSmallPrime( int i )
28{
29    ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" );
30    return smallprimes[i];
31}
32
33int cf_getNumSmallPrimes()
34{
35    return NUMSMALLPRIMES;
36}
37
38int cf_getBigPrime( int i )
39{
40    ASSERT( i >= 0 && i < NUMBIGPRIMES, "index to primes too high" );
41    return bigprimes[i];
42}
43
44int cf_getNumBigPrimes()
45{
46    return NUMBIGPRIMES;
47}
Note: See TracBrowser for help on using the repository browser.