intmath.hh (6214:1ec0ec8933ae) intmath.hh (6216:2f4020838149)
1/*
2 * Copyright (c) 2001, 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 */
30
1/*
2 * Copyright (c) 2001, 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#ifndef __INTMATH_HH__
32#define __INTMATH_HH__
31#ifndef __BASE_INTMATH_HH__
32#define __BASE_INTMATH_HH__
33
33
34#include <assert.h>
34#include <cassert>
35
36#include "base/types.hh"
37
38// Returns the prime number one less than n.
39int prevPrime(int n);
40
41// Determine if a number is prime
42template <class T>

--- 181 unchanged lines hidden (view full) ---

224 return (c - 'A') + 10;
225
226 if (c >= 'a' && c <= 'f')
227 return (c - 'a') + 10;
228
229 return 0;
230}
231
35
36#include "base/types.hh"
37
38// Returns the prime number one less than n.
39int prevPrime(int n);
40
41// Determine if a number is prime
42template <class T>

--- 181 unchanged lines hidden (view full) ---

224 return (c - 'A') + 10;
225
226 if (c >= 'a' && c <= 'f')
227 return (c - 'a') + 10;
228
229 return 0;
230}
231
232#endif // __INTMATH_HH__
232#endif // __BASE_INTMATH_HH__