comparison libdecnumber/decDouble.c @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 77e2b8dfacca
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 /* decDouble module for the decNumber C Library.
2 Copyright (C) 2007, 2009 Free Software Foundation, Inc.
3 Contributed by IBM Corporation. Author Mike Cowlishaw.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
25
26 /* ------------------------------------------------------------------ */
27 /* decDouble.c -- decDouble operations module */
28 /* ------------------------------------------------------------------ */
29 /* This module comprises decDouble operations (including conversions) */
30 /* ------------------------------------------------------------------ */
31
32 #include "decContext.h" /* public includes */
33 #include "decDouble.h" /* .. */
34
35 /* Constant mappings for shared code */
36 #define DECPMAX DECDOUBLE_Pmax
37 #define DECEMIN DECDOUBLE_Emin
38 #define DECEMAX DECDOUBLE_Emax
39 #define DECEMAXD DECDOUBLE_EmaxD
40 #define DECBYTES DECDOUBLE_Bytes
41 #define DECSTRING DECDOUBLE_String
42 #define DECECONL DECDOUBLE_EconL
43 #define DECBIAS DECDOUBLE_Bias
44 #define DECLETS DECDOUBLE_Declets
45 #define DECQTINY (-DECDOUBLE_Bias)
46 /* parameters of next-wider format */
47 #define DECWBYTES DECQUAD_Bytes
48 #define DECWPMAX DECQUAD_Pmax
49 #define DECWECONL DECQUAD_EconL
50 #define DECWBIAS DECQUAD_Bias
51
52 /* Type and function mappings for shared code */
53 #define decFloat decDouble /* Type name */
54 #define decFloatWider decQuad /* Type name */
55
56 /* Utilities and conversions (binary results, extractors, etc.) */
57 #define decFloatFromBCD decDoubleFromBCD
58 #define decFloatFromInt32 decDoubleFromInt32
59 #define decFloatFromPacked decDoubleFromPacked
60 #define decFloatFromString decDoubleFromString
61 #define decFloatFromUInt32 decDoubleFromUInt32
62 #define decFloatFromWider decDoubleFromWider
63 #define decFloatGetCoefficient decDoubleGetCoefficient
64 #define decFloatGetExponent decDoubleGetExponent
65 #define decFloatSetCoefficient decDoubleSetCoefficient
66 #define decFloatSetExponent decDoubleSetExponent
67 #define decFloatShow decDoubleShow
68 #define decFloatToBCD decDoubleToBCD
69 #define decFloatToEngString decDoubleToEngString
70 #define decFloatToInt32 decDoubleToInt32
71 #define decFloatToInt32Exact decDoubleToInt32Exact
72 #define decFloatToPacked decDoubleToPacked
73 #define decFloatToString decDoubleToString
74 #define decFloatToUInt32 decDoubleToUInt32
75 #define decFloatToUInt32Exact decDoubleToUInt32Exact
76 #define decFloatToWider decDoubleToWider
77 #define decFloatZero decDoubleZero
78
79 /* Computational (result is a decFloat) */
80 #define decFloatAbs decDoubleAbs
81 #define decFloatAdd decDoubleAdd
82 #define decFloatAnd decDoubleAnd
83 #define decFloatDivide decDoubleDivide
84 #define decFloatDivideInteger decDoubleDivideInteger
85 #define decFloatFMA decDoubleFMA
86 #define decFloatInvert decDoubleInvert
87 #define decFloatLogB decDoubleLogB
88 #define decFloatMax decDoubleMax
89 #define decFloatMaxMag decDoubleMaxMag
90 #define decFloatMin decDoubleMin
91 #define decFloatMinMag decDoubleMinMag
92 #define decFloatMinus decDoubleMinus
93 #define decFloatMultiply decDoubleMultiply
94 #define decFloatNextMinus decDoubleNextMinus
95 #define decFloatNextPlus decDoubleNextPlus
96 #define decFloatNextToward decDoubleNextToward
97 #define decFloatOr decDoubleOr
98 #define decFloatPlus decDoublePlus
99 #define decFloatQuantize decDoubleQuantize
100 #define decFloatReduce decDoubleReduce
101 #define decFloatRemainder decDoubleRemainder
102 #define decFloatRemainderNear decDoubleRemainderNear
103 #define decFloatRotate decDoubleRotate
104 #define decFloatScaleB decDoubleScaleB
105 #define decFloatShift decDoubleShift
106 #define decFloatSubtract decDoubleSubtract
107 #define decFloatToIntegralValue decDoubleToIntegralValue
108 #define decFloatToIntegralExact decDoubleToIntegralExact
109 #define decFloatXor decDoubleXor
110
111 /* Comparisons */
112 #define decFloatCompare decDoubleCompare
113 #define decFloatCompareSignal decDoubleCompareSignal
114 #define decFloatCompareTotal decDoubleCompareTotal
115 #define decFloatCompareTotalMag decDoubleCompareTotalMag
116
117 /* Copies */
118 #define decFloatCanonical decDoubleCanonical
119 #define decFloatCopy decDoubleCopy
120 #define decFloatCopyAbs decDoubleCopyAbs
121 #define decFloatCopyNegate decDoubleCopyNegate
122 #define decFloatCopySign decDoubleCopySign
123
124 /* Non-computational */
125 #define decFloatClass decDoubleClass
126 #define decFloatClassString decDoubleClassString
127 #define decFloatDigits decDoubleDigits
128 #define decFloatIsCanonical decDoubleIsCanonical
129 #define decFloatIsFinite decDoubleIsFinite
130 #define decFloatIsInfinite decDoubleIsInfinite
131 #define decFloatIsInteger decDoubleIsInteger
132 #define decFloatIsNaN decDoubleIsNaN
133 #define decFloatIsNormal decDoubleIsNormal
134 #define decFloatIsSignaling decDoubleIsSignaling
135 #define decFloatIsSignalling decDoubleIsSignalling
136 #define decFloatIsSigned decDoubleIsSigned
137 #define decFloatIsSubnormal decDoubleIsSubnormal
138 #define decFloatIsZero decDoubleIsZero
139 #define decFloatRadix decDoubleRadix
140 #define decFloatSameQuantum decDoubleSameQuantum
141 #define decFloatVersion decDoubleVersion
142
143
144 #include "decNumberLocal.h" /* local includes (need DECPMAX) */
145 #include "decCommon.c" /* non-arithmetic decFloat routines */
146 #include "decBasic.c" /* basic formats routines */
147
148 /* Below here will move to shared file as completed */
149