scfx_pow10.h revision 12027
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  scfx_pow10.h -
23
24  Original Author: Robert Graulich, Synopsys, Inc.
25                   Martin Janssen,  Synopsys, Inc.
26
27 *****************************************************************************/
28
29/*****************************************************************************
30
31  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
32  changes you are making here.
33
34      Name, Affiliation, Date:
35  Description of Modification:
36
37 *****************************************************************************/
38
39// $Log: scfx_pow10.h,v $
40// Revision 1.1.1.1  2006/12/15 20:20:04  acg
41// SystemC 2.3
42//
43// Revision 1.3  2006/01/13 18:53:58  acg
44// Andy Goodrich: added $Log command so that CVS comments are reproduced in
45// the source.
46//
47
48#ifndef SCFX_POW10_H
49#define SCFX_POW10_H
50
51
52#include "sysc/datatypes/fx/scfx_rep.h"
53
54
55namespace sc_dt
56{
57
58// classes defined in this module
59class scfx_pow10;
60
61
62// ----------------------------------------------------------------------------
63//  CLASS : scfx_pow10
64//
65//  Class to compute (and cache) powers of 10 in arbitrary precision.
66// ----------------------------------------------------------------------------
67
68const int SCFX_POW10_TABLE_SIZE = 32;
69
70
71class scfx_pow10
72{
73
74public:
75
76    scfx_pow10();
77    ~scfx_pow10();
78
79    const scfx_rep operator() ( int );
80
81private:
82
83    scfx_rep* pos( int );
84    scfx_rep* neg( int );
85
86    scfx_rep m_pos[SCFX_POW10_TABLE_SIZE];
87    scfx_rep m_neg[SCFX_POW10_TABLE_SIZE];
88};
89
90} // namespace sc_dt
91
92
93#endif
94
95// Taf!
96