comparison libdecnumber/decQuad.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 /* decQuad 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 /* decQuad.c -- decQuad operations module */
28 /* ------------------------------------------------------------------ */
29 /* This module comprises decQuad operations (including conversions) */
30 /* ------------------------------------------------------------------ */
31
32 #include "decContext.h" /* public includes */
33 #include "decQuad.h" /* .. */
34
35 /* Constant mappings for shared code */
36 #define DECPMAX DECQUAD_Pmax
37 #define DECEMIN DECQUAD_Emin
38 #define DECEMAX DECQUAD_Emax
39 #define DECEMAXD DECQUAD_EmaxD
40 #define DECBYTES DECQUAD_Bytes
41 #define DECSTRING DECQUAD_String
42 #define DECECONL DECQUAD_EconL
43 #define DECBIAS DECQUAD_Bias
44 #define DECLETS DECQUAD_Declets
45 #define DECQTINY (-DECQUAD_Bias)
46
47 /* Type and function mappings for shared code */
48 #define decFloat decQuad /* Type name */
49
50 /* Utilities and conversions (binary results, extractors, etc.) */
51 #define decFloatFromBCD decQuadFromBCD
52 #define decFloatFromInt32 decQuadFromInt32
53 #define decFloatFromPacked decQuadFromPacked
54 #define decFloatFromString decQuadFromString
55 #define decFloatFromUInt32 decQuadFromUInt32
56 #define decFloatFromWider decQuadFromWider
57 #define decFloatGetCoefficient decQuadGetCoefficient
58 #define decFloatGetExponent decQuadGetExponent
59 #define decFloatSetCoefficient decQuadSetCoefficient
60 #define decFloatSetExponent decQuadSetExponent
61 #define decFloatShow decQuadShow
62 #define decFloatToBCD decQuadToBCD
63 #define decFloatToEngString decQuadToEngString
64 #define decFloatToInt32 decQuadToInt32
65 #define decFloatToInt32Exact decQuadToInt32Exact
66 #define decFloatToPacked decQuadToPacked
67 #define decFloatToString decQuadToString
68 #define decFloatToUInt32 decQuadToUInt32
69 #define decFloatToUInt32Exact decQuadToUInt32Exact
70 #define decFloatToWider decQuadToWider
71 #define decFloatZero decQuadZero
72
73 /* Computational (result is a decFloat) */
74 #define decFloatAbs decQuadAbs
75 #define decFloatAdd decQuadAdd
76 #define decFloatAnd decQuadAnd
77 #define decFloatDivide decQuadDivide
78 #define decFloatDivideInteger decQuadDivideInteger
79 #define decFloatFMA decQuadFMA
80 #define decFloatInvert decQuadInvert
81 #define decFloatLogB decQuadLogB
82 #define decFloatMax decQuadMax
83 #define decFloatMaxMag decQuadMaxMag
84 #define decFloatMin decQuadMin
85 #define decFloatMinMag decQuadMinMag
86 #define decFloatMinus decQuadMinus
87 #define decFloatMultiply decQuadMultiply
88 #define decFloatNextMinus decQuadNextMinus
89 #define decFloatNextPlus decQuadNextPlus
90 #define decFloatNextToward decQuadNextToward
91 #define decFloatOr decQuadOr
92 #define decFloatPlus decQuadPlus
93 #define decFloatQuantize decQuadQuantize
94 #define decFloatReduce decQuadReduce
95 #define decFloatRemainder decQuadRemainder
96 #define decFloatRemainderNear decQuadRemainderNear
97 #define decFloatRotate decQuadRotate
98 #define decFloatScaleB decQuadScaleB
99 #define decFloatShift decQuadShift
100 #define decFloatSubtract decQuadSubtract
101 #define decFloatToIntegralValue decQuadToIntegralValue
102 #define decFloatToIntegralExact decQuadToIntegralExact
103 #define decFloatXor decQuadXor
104
105 /* Comparisons */
106 #define decFloatCompare decQuadCompare
107 #define decFloatCompareSignal decQuadCompareSignal
108 #define decFloatCompareTotal decQuadCompareTotal
109 #define decFloatCompareTotalMag decQuadCompareTotalMag
110
111 /* Copies */
112 #define decFloatCanonical decQuadCanonical
113 #define decFloatCopy decQuadCopy
114 #define decFloatCopyAbs decQuadCopyAbs
115 #define decFloatCopyNegate decQuadCopyNegate
116 #define decFloatCopySign decQuadCopySign
117
118 /* Non-computational */
119 #define decFloatClass decQuadClass
120 #define decFloatClassString decQuadClassString
121 #define decFloatDigits decQuadDigits
122 #define decFloatIsCanonical decQuadIsCanonical
123 #define decFloatIsFinite decQuadIsFinite
124 #define decFloatIsInfinite decQuadIsInfinite
125 #define decFloatIsInteger decQuadIsInteger
126 #define decFloatIsNaN decQuadIsNaN
127 #define decFloatIsNormal decQuadIsNormal
128 #define decFloatIsSignaling decQuadIsSignaling
129 #define decFloatIsSignalling decQuadIsSignalling
130 #define decFloatIsSigned decQuadIsSigned
131 #define decFloatIsSubnormal decQuadIsSubnormal
132 #define decFloatIsZero decQuadIsZero
133 #define decFloatRadix decQuadRadix
134 #define decFloatSameQuantum decQuadSameQuantum
135 #define decFloatVersion decQuadVersion
136
137
138 #include "decNumberLocal.h" /* local includes (need DECPMAX) */
139 #include "decCommon.c" /* non-arithmetic decFloat routines */
140 #include "decBasic.c" /* basic formats routines */
141