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 __SYSTEMC_EXT_DT_FX_SCFX_POW10_HH__
49#define __SYSTEMC_EXT_DT_FX_SCFX_POW10_HH__
50
51#include "scfx_rep.hh"
52
53namespace sc_dt
54{
55
56// classes defined in this module
57class scfx_pow10;
58
59
60// ----------------------------------------------------------------------------
61//  CLASS : scfx_pow10
62//
63//  Class to compute (and cache) powers of 10 in arbitrary precision.
64// ----------------------------------------------------------------------------
65
66const int SCFX_POW10_TABLE_SIZE = 32;
67
68class scfx_pow10
69{
70  public:
71    scfx_pow10();
72    ~scfx_pow10();
73
74    const scfx_rep operator() (int);
75
76  private:
77    scfx_rep *pos(int);
78    scfx_rep *neg(int);
79
80    scfx_rep m_pos[SCFX_POW10_TABLE_SIZE];
81    scfx_rep m_neg[SCFX_POW10_TABLE_SIZE];
82};
83
84} // namespace sc_dt
85
86#endif // __SYSTEMC_EXT_DT_FX_SCFX_POW10_HH__
87