libstdc++
|
00001 // <decimal> -*- C++ -*- 00002 00003 // Copyright (C) 2009-2015 Free Software Foundation, Inc. 00004 // This file is part of the GNU ISO C++ Library. This library is free 00005 // software; you can redistribute it and/or modify it under the 00006 // terms of the GNU General Public License as published by the 00007 // Free Software Foundation; either version 3, or (at your option) 00008 // any later version. 00009 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 00015 // Under Section 7 of GPL version 3, you are granted additional 00016 // permissions described in the GCC Runtime Library Exception, version 00017 // 3.1, as published by the Free Software Foundation. 00018 00019 // You should have received a copy of the GNU General Public License and 00020 // a copy of the GCC Runtime Library Exception along with this program; 00021 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00022 // <http://www.gnu.org/licenses/>. 00023 00024 /** @file decimal/decimal 00025 * This is a Standard C++ Library header. 00026 */ 00027 00028 // ISO/IEC TR 24733 00029 // Written by Janis Johnson <janis187@us.ibm.com> 00030 00031 #ifndef _GLIBCXX_DECIMAL 00032 #define _GLIBCXX_DECIMAL 1 00033 00034 #pragma GCC system_header 00035 00036 #include <bits/c++config.h> 00037 00038 #ifndef _GLIBCXX_USE_DECIMAL_FLOAT 00039 #error This file requires compiler and library support for ISO/IEC TR 24733 \ 00040 that is currently not available. 00041 #endif 00042 00043 namespace std _GLIBCXX_VISIBILITY(default) 00044 { 00045 /** 00046 * @defgroup decimal Decimal Floating-Point Arithmetic 00047 * @ingroup numerics 00048 * 00049 * Classes and functions for decimal floating-point arithmetic. 00050 * @{ 00051 */ 00052 00053 /** @namespace std::decimal 00054 * @brief ISO/IEC TR 24733 Decimal floating-point arithmetic. 00055 */ 00056 namespace decimal 00057 { 00058 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00059 00060 class decimal32; 00061 class decimal64; 00062 class decimal128; 00063 00064 // 3.2.5 Initialization from coefficient and exponent. 00065 static decimal32 make_decimal32(long long __coeff, int __exp); 00066 static decimal32 make_decimal32(unsigned long long __coeff, int __exp); 00067 static decimal64 make_decimal64(long long __coeff, int __exp); 00068 static decimal64 make_decimal64(unsigned long long __coeff, int __exp); 00069 static decimal128 make_decimal128(long long __coeff, int __exp); 00070 static decimal128 make_decimal128(unsigned long long __coeff, int __exp); 00071 00072 /// Non-conforming extension: Conversion to integral type. 00073 long long decimal32_to_long_long(decimal32 __d); 00074 long long decimal64_to_long_long(decimal64 __d); 00075 long long decimal128_to_long_long(decimal128 __d); 00076 long long decimal_to_long_long(decimal32 __d); 00077 long long decimal_to_long_long(decimal64 __d); 00078 long long decimal_to_long_long(decimal128 __d); 00079 00080 // 3.2.6 Conversion to generic floating-point type. 00081 float decimal32_to_float(decimal32 __d); 00082 float decimal64_to_float(decimal64 __d); 00083 float decimal128_to_float(decimal128 __d); 00084 float decimal_to_float(decimal32 __d); 00085 float decimal_to_float(decimal64 __d); 00086 float decimal_to_float(decimal128 __d); 00087 00088 double decimal32_to_double(decimal32 __d); 00089 double decimal64_to_double(decimal64 __d); 00090 double decimal128_to_double(decimal128 __d); 00091 double decimal_to_double(decimal32 __d); 00092 double decimal_to_double(decimal64 __d); 00093 double decimal_to_double(decimal128 __d); 00094 00095 long double decimal32_to_long_double(decimal32 __d); 00096 long double decimal64_to_long_double(decimal64 __d); 00097 long double decimal128_to_long_double(decimal128 __d); 00098 long double decimal_to_long_double(decimal32 __d); 00099 long double decimal_to_long_double(decimal64 __d); 00100 long double decimal_to_long_double(decimal128 __d); 00101 00102 // 3.2.7 Unary arithmetic operators. 00103 decimal32 operator+(decimal32 __rhs); 00104 decimal64 operator+(decimal64 __rhs); 00105 decimal128 operator+(decimal128 __rhs); 00106 decimal32 operator-(decimal32 __rhs); 00107 decimal64 operator-(decimal64 __rhs); 00108 decimal128 operator-(decimal128 __rhs); 00109 00110 // 3.2.8 Binary arithmetic operators. 00111 #define _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(_Op, _T1, _T2, _T3) \ 00112 _T1 operator _Op(_T2 __lhs, _T3 __rhs); 00113 #define _DECLARE_DECIMAL_BINARY_OP_WITH_INT(_Op, _Tp) \ 00114 _Tp operator _Op(_Tp __lhs, int __rhs); \ 00115 _Tp operator _Op(_Tp __lhs, unsigned int __rhs); \ 00116 _Tp operator _Op(_Tp __lhs, long __rhs); \ 00117 _Tp operator _Op(_Tp __lhs, unsigned long __rhs); \ 00118 _Tp operator _Op(_Tp __lhs, long long __rhs); \ 00119 _Tp operator _Op(_Tp __lhs, unsigned long long __rhs); \ 00120 _Tp operator _Op(int __lhs, _Tp __rhs); \ 00121 _Tp operator _Op(unsigned int __lhs, _Tp __rhs); \ 00122 _Tp operator _Op(long __lhs, _Tp __rhs); \ 00123 _Tp operator _Op(unsigned long __lhs, _Tp __rhs); \ 00124 _Tp operator _Op(long long __lhs, _Tp __rhs); \ 00125 _Tp operator _Op(unsigned long long __lhs, _Tp __rhs); 00126 00127 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal32, decimal32, decimal32) 00128 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal32) 00129 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal32, decimal64) 00130 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal32) 00131 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal64, decimal64, decimal64) 00132 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal64) 00133 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal32, decimal128) 00134 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal64, decimal128) 00135 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal32) 00136 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal64) 00137 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(+, decimal128, decimal128, decimal128) 00138 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(+, decimal128) 00139 00140 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal32, decimal32, decimal32) 00141 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal32) 00142 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal32, decimal64) 00143 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal32) 00144 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal64, decimal64, decimal64) 00145 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal64) 00146 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal32, decimal128) 00147 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal64, decimal128) 00148 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal32) 00149 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal64) 00150 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(-, decimal128, decimal128, decimal128) 00151 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(-, decimal128) 00152 00153 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal32, decimal32, decimal32) 00154 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal32) 00155 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal32, decimal64) 00156 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal32) 00157 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal64, decimal64, decimal64) 00158 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal64) 00159 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal32, decimal128) 00160 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal64, decimal128) 00161 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal32) 00162 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal64) 00163 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(*, decimal128, decimal128, decimal128) 00164 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(*, decimal128) 00165 00166 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal32, decimal32, decimal32) 00167 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal32) 00168 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal32, decimal64) 00169 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal32) 00170 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal64, decimal64, decimal64) 00171 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal64) 00172 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal32, decimal128) 00173 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal64, decimal128) 00174 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal32) 00175 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal64) 00176 _DECLARE_DECIMAL_BINARY_OP_WITH_DEC(/, decimal128, decimal128, decimal128) 00177 _DECLARE_DECIMAL_BINARY_OP_WITH_INT(/, decimal128) 00178 00179 #undef _DECLARE_DECIMAL_BINARY_OP_WITH_DEC 00180 #undef _DECLARE_DECIMAL_BINARY_OP_WITH_INT 00181 00182 // 3.2.9 Comparison operators. 00183 #define _DECLARE_DECIMAL_COMPARISON(_Op, _Tp) \ 00184 bool operator _Op(_Tp __lhs, decimal32 __rhs); \ 00185 bool operator _Op(_Tp __lhs, decimal64 __rhs); \ 00186 bool operator _Op(_Tp __lhs, decimal128 __rhs); \ 00187 bool operator _Op(_Tp __lhs, int __rhs); \ 00188 bool operator _Op(_Tp __lhs, unsigned int __rhs); \ 00189 bool operator _Op(_Tp __lhs, long __rhs); \ 00190 bool operator _Op(_Tp __lhs, unsigned long __rhs); \ 00191 bool operator _Op(_Tp __lhs, long long __rhs); \ 00192 bool operator _Op(_Tp __lhs, unsigned long long __rhs); \ 00193 bool operator _Op(int __lhs, _Tp __rhs); \ 00194 bool operator _Op(unsigned int __lhs, _Tp __rhs); \ 00195 bool operator _Op(long __lhs, _Tp __rhs); \ 00196 bool operator _Op(unsigned long __lhs, _Tp __rhs); \ 00197 bool operator _Op(long long __lhs, _Tp __rhs); \ 00198 bool operator _Op(unsigned long long __lhs, _Tp __rhs); 00199 00200 _DECLARE_DECIMAL_COMPARISON(==, decimal32) 00201 _DECLARE_DECIMAL_COMPARISON(==, decimal64) 00202 _DECLARE_DECIMAL_COMPARISON(==, decimal128) 00203 00204 _DECLARE_DECIMAL_COMPARISON(!=, decimal32) 00205 _DECLARE_DECIMAL_COMPARISON(!=, decimal64) 00206 _DECLARE_DECIMAL_COMPARISON(!=, decimal128) 00207 00208 _DECLARE_DECIMAL_COMPARISON(<, decimal32) 00209 _DECLARE_DECIMAL_COMPARISON(<, decimal64) 00210 _DECLARE_DECIMAL_COMPARISON(<, decimal128) 00211 00212 _DECLARE_DECIMAL_COMPARISON(>=, decimal32) 00213 _DECLARE_DECIMAL_COMPARISON(>=, decimal64) 00214 _DECLARE_DECIMAL_COMPARISON(>=, decimal128) 00215 00216 _DECLARE_DECIMAL_COMPARISON(>, decimal32) 00217 _DECLARE_DECIMAL_COMPARISON(>, decimal64) 00218 _DECLARE_DECIMAL_COMPARISON(>, decimal128) 00219 00220 _DECLARE_DECIMAL_COMPARISON(>=, decimal32) 00221 _DECLARE_DECIMAL_COMPARISON(>=, decimal64) 00222 _DECLARE_DECIMAL_COMPARISON(>=, decimal128) 00223 00224 #undef _DECLARE_DECIMAL_COMPARISON 00225 00226 /// 3.2.2 Class decimal32. 00227 class decimal32 00228 { 00229 public: 00230 typedef float __decfloat32 __attribute__((mode(SD))); 00231 00232 // 3.2.2.2 Construct/copy/destroy. 00233 decimal32() : __val(0.e-101DF) {} 00234 00235 // 3.2.2.3 Conversion from floating-point type. 00236 explicit decimal32(decimal64 __d64); 00237 explicit decimal32(decimal128 __d128); 00238 explicit decimal32(float __r) : __val(__r) {} 00239 explicit decimal32(double __r) : __val(__r) {} 00240 explicit decimal32(long double __r) : __val(__r) {} 00241 00242 // 3.2.2.4 Conversion from integral type. 00243 decimal32(int __z) : __val(__z) {} 00244 decimal32(unsigned int __z) : __val(__z) {} 00245 decimal32(long __z) : __val(__z) {} 00246 decimal32(unsigned long __z) : __val(__z) {} 00247 decimal32(long long __z) : __val(__z) {} 00248 decimal32(unsigned long long __z) : __val(__z) {} 00249 00250 /// Conforming extension: Conversion from scalar decimal type. 00251 decimal32(__decfloat32 __z) : __val(__z) {} 00252 00253 #if __cplusplus >= 201103L 00254 // 3.2.2.5 Conversion to integral type. 00255 // Note: explicit per n3407. 00256 explicit operator long long() const { return (long long)__val; } 00257 #endif 00258 00259 // 3.2.2.6 Increment and decrement operators. 00260 decimal32& operator++() 00261 { 00262 __val += 1; 00263 return *this; 00264 } 00265 00266 decimal32 operator++(int) 00267 { 00268 decimal32 __tmp = *this; 00269 __val += 1; 00270 return __tmp; 00271 } 00272 00273 decimal32& operator--() 00274 { 00275 __val -= 1; 00276 return *this; 00277 } 00278 00279 decimal32 operator--(int) 00280 { 00281 decimal32 __tmp = *this; 00282 __val -= 1; 00283 return __tmp; 00284 } 00285 00286 // 3.2.2.7 Compound assignment. 00287 #define _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(_Op) \ 00288 decimal32& operator _Op(decimal32 __rhs); \ 00289 decimal32& operator _Op(decimal64 __rhs); \ 00290 decimal32& operator _Op(decimal128 __rhs); \ 00291 decimal32& operator _Op(int __rhs); \ 00292 decimal32& operator _Op(unsigned int __rhs); \ 00293 decimal32& operator _Op(long __rhs); \ 00294 decimal32& operator _Op(unsigned long __rhs); \ 00295 decimal32& operator _Op(long long __rhs); \ 00296 decimal32& operator _Op(unsigned long long __rhs); 00297 00298 _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(+=) 00299 _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(-=) 00300 _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(*=) 00301 _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT(/=) 00302 #undef _DECLARE_DECIMAL32_COMPOUND_ASSIGNMENT 00303 00304 private: 00305 __decfloat32 __val; 00306 00307 public: 00308 __decfloat32 __getval(void) { return __val; } 00309 void __setval(__decfloat32 __x) { __val = __x; } 00310 }; 00311 00312 /// 3.2.3 Class decimal64. 00313 class decimal64 00314 { 00315 public: 00316 typedef float __decfloat64 __attribute__((mode(DD))); 00317 00318 // 3.2.3.2 Construct/copy/destroy. 00319 decimal64() : __val(0.e-398dd) {} 00320 00321 // 3.2.3.3 Conversion from floating-point type. 00322 decimal64(decimal32 d32); 00323 explicit decimal64(decimal128 d128); 00324 explicit decimal64(float __r) : __val(__r) {} 00325 explicit decimal64(double __r) : __val(__r) {} 00326 explicit decimal64(long double __r) : __val(__r) {} 00327 00328 // 3.2.3.4 Conversion from integral type. 00329 decimal64(int __z) : __val(__z) {} 00330 decimal64(unsigned int __z) : __val(__z) {} 00331 decimal64(long __z) : __val(__z) {} 00332 decimal64(unsigned long __z) : __val(__z) {} 00333 decimal64(long long __z) : __val(__z) {} 00334 decimal64(unsigned long long __z) : __val(__z) {} 00335 00336 /// Conforming extension: Conversion from scalar decimal type. 00337 decimal64(__decfloat64 __z) : __val(__z) {} 00338 00339 #if __cplusplus >= 201103L 00340 // 3.2.3.5 Conversion to integral type. 00341 // Note: explicit per n3407. 00342 explicit operator long long() const { return (long long)__val; } 00343 #endif 00344 00345 // 3.2.3.6 Increment and decrement operators. 00346 decimal64& operator++() 00347 { 00348 __val += 1; 00349 return *this; 00350 } 00351 00352 decimal64 operator++(int) 00353 { 00354 decimal64 __tmp = *this; 00355 __val += 1; 00356 return __tmp; 00357 } 00358 00359 decimal64& operator--() 00360 { 00361 __val -= 1; 00362 return *this; 00363 } 00364 00365 decimal64 operator--(int) 00366 { 00367 decimal64 __tmp = *this; 00368 __val -= 1; 00369 return __tmp; 00370 } 00371 00372 // 3.2.3.7 Compound assignment. 00373 #define _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(_Op) \ 00374 decimal64& operator _Op(decimal32 __rhs); \ 00375 decimal64& operator _Op(decimal64 __rhs); \ 00376 decimal64& operator _Op(decimal128 __rhs); \ 00377 decimal64& operator _Op(int __rhs); \ 00378 decimal64& operator _Op(unsigned int __rhs); \ 00379 decimal64& operator _Op(long __rhs); \ 00380 decimal64& operator _Op(unsigned long __rhs); \ 00381 decimal64& operator _Op(long long __rhs); \ 00382 decimal64& operator _Op(unsigned long long __rhs); 00383 00384 _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(+=) 00385 _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(-=) 00386 _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(*=) 00387 _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT(/=) 00388 #undef _DECLARE_DECIMAL64_COMPOUND_ASSIGNMENT 00389 00390 private: 00391 __decfloat64 __val; 00392 00393 public: 00394 __decfloat64 __getval(void) { return __val; } 00395 void __setval(__decfloat64 __x) { __val = __x; } 00396 }; 00397 00398 /// 3.2.4 Class decimal128. 00399 class decimal128 00400 { 00401 public: 00402 typedef float __decfloat128 __attribute__((mode(TD))); 00403 00404 // 3.2.4.2 Construct/copy/destroy. 00405 decimal128() : __val(0.e-6176DL) {} 00406 00407 // 3.2.4.3 Conversion from floating-point type. 00408 decimal128(decimal32 d32); 00409 decimal128(decimal64 d64); 00410 explicit decimal128(float __r) : __val(__r) {} 00411 explicit decimal128(double __r) : __val(__r) {} 00412 explicit decimal128(long double __r) : __val(__r) {} 00413 00414 00415 // 3.2.4.4 Conversion from integral type. 00416 decimal128(int __z) : __val(__z) {} 00417 decimal128(unsigned int __z) : __val(__z) {} 00418 decimal128(long __z) : __val(__z) {} 00419 decimal128(unsigned long __z) : __val(__z) {} 00420 decimal128(long long __z) : __val(__z) {} 00421 decimal128(unsigned long long __z) : __val(__z) {} 00422 00423 /// Conforming extension: Conversion from scalar decimal type. 00424 decimal128(__decfloat128 __z) : __val(__z) {} 00425 00426 #if __cplusplus >= 201103L 00427 // 3.2.4.5 Conversion to integral type. 00428 // Note: explicit per n3407. 00429 explicit operator long long() const { return (long long)__val; } 00430 #endif 00431 00432 // 3.2.4.6 Increment and decrement operators. 00433 decimal128& operator++() 00434 { 00435 __val += 1; 00436 return *this; 00437 } 00438 00439 decimal128 operator++(int) 00440 { 00441 decimal128 __tmp = *this; 00442 __val += 1; 00443 return __tmp; 00444 } 00445 00446 decimal128& operator--() 00447 { 00448 __val -= 1; 00449 return *this; 00450 } 00451 00452 decimal128 operator--(int) 00453 { 00454 decimal128 __tmp = *this; 00455 __val -= 1; 00456 return __tmp; 00457 } 00458 00459 // 3.2.4.7 Compound assignment. 00460 #define _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(_Op) \ 00461 decimal128& operator _Op(decimal32 __rhs); \ 00462 decimal128& operator _Op(decimal64 __rhs); \ 00463 decimal128& operator _Op(decimal128 __rhs); \ 00464 decimal128& operator _Op(int __rhs); \ 00465 decimal128& operator _Op(unsigned int __rhs); \ 00466 decimal128& operator _Op(long __rhs); \ 00467 decimal128& operator _Op(unsigned long __rhs); \ 00468 decimal128& operator _Op(long long __rhs); \ 00469 decimal128& operator _Op(unsigned long long __rhs); 00470 00471 _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(+=) 00472 _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(-=) 00473 _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(*=) 00474 _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT(/=) 00475 #undef _DECLARE_DECIMAL128_COMPOUND_ASSIGNMENT 00476 00477 private: 00478 __decfloat128 __val; 00479 00480 public: 00481 __decfloat128 __getval(void) { return __val; } 00482 void __setval(__decfloat128 __x) { __val = __x; } 00483 }; 00484 00485 #define _GLIBCXX_USE_DECIMAL_ 1 00486 00487 _GLIBCXX_END_NAMESPACE_VERSION 00488 } // namespace decimal 00489 // @} group decimal 00490 } // namespace std 00491 00492 #include <decimal/decimal.h> 00493 00494 #endif /* _GLIBCXX_DECIMAL */