comparison libdecnumber/dpd/decimal32.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children 04ced10e8804
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
28 /* ------------------------------------------------------------------ */ 28 /* ------------------------------------------------------------------ */
29 29
30 #if !defined(DECIMAL32) 30 #if !defined(DECIMAL32)
31 #define DECIMAL32 31 #define DECIMAL32
32 #define DEC32NAME "decimal32" /* Short name */ 32 #define DEC32NAME "decimal32" /* Short name */
33 #define DEC32FULLNAME "Decimal 32-bit Number" /* Verbose name */ 33 #define DEC32FULLNAME "Decimal 32-bit Number" /* Verbose name */
34 #define DEC32AUTHOR "Mike Cowlishaw" /* Who to blame */ 34 #define DEC32AUTHOR "Mike Cowlishaw" /* Who to blame */
35 35
36 /* parameters for decimal32s */ 36 /* parameters for decimal32s */
37 #define DECIMAL32_Bytes 4 /* length */ 37 #define DECIMAL32_Bytes 4 /* length */
38 #define DECIMAL32_Pmax 7 /* maximum precision (digits) */ 38 #define DECIMAL32_Pmax 7 /* maximum precision (digits) */
39 #define DECIMAL32_Emax 96 /* maximum adjusted exponent */ 39 #define DECIMAL32_Emax 96 /* maximum adjusted exponent */
40 #define DECIMAL32_Emin -95 /* minimum adjusted exponent */ 40 #define DECIMAL32_Emin -95 /* minimum adjusted exponent */
41 #define DECIMAL32_Bias 101 /* bias for the exponent */ 41 #define DECIMAL32_Bias 101 /* bias for the exponent */
42 #define DECIMAL32_String 15 /* maximum string length, +1 */ 42 #define DECIMAL32_String 15 /* maximum string length, +1 */
43 #define DECIMAL32_EconL 6 /* exp. continuation length */ 43 #define DECIMAL32_EconL 6 /* exp. continuation length */
44 /* highest biased exponent (Elimit-1) */ 44 /* highest biased exponent (Elimit-1) */
45 #define DECIMAL32_Ehigh (DECIMAL32_Emax+DECIMAL32_Bias-DECIMAL32_Pmax+1) 45 #define DECIMAL32_Ehigh (DECIMAL32_Emax+DECIMAL32_Bias-DECIMAL32_Pmax+1)
46 46
47 /* check enough digits, if pre-defined */ 47 /* check enough digits, if pre-defined */
48 #if defined(DECNUMDIGITS) 48 #if defined(DECNUMDIGITS)
49 #if (DECNUMDIGITS<DECIMAL32_Pmax) 49 #if (DECNUMDIGITS<DECIMAL32_Pmax)
64 } decimal32; 64 } decimal32;
65 65
66 /* special values [top byte excluding sign bit; last two bits are */ 66 /* special values [top byte excluding sign bit; last two bits are */
67 /* don't-care for Infinity on input, last bit don't-care for NaN] */ 67 /* don't-care for Infinity on input, last bit don't-care for NaN] */
68 #if !defined(DECIMAL_NaN) 68 #if !defined(DECIMAL_NaN)
69 #define DECIMAL_NaN 0x7c /* 0 11111 00 NaN */ 69 #define DECIMAL_NaN 0x7c /* 0 11111 00 NaN */
70 #define DECIMAL_sNaN 0x7e /* 0 11111 10 sNaN */ 70 #define DECIMAL_sNaN 0x7e /* 0 11111 10 sNaN */
71 #define DECIMAL_Inf 0x78 /* 0 11110 00 Infinity */ 71 #define DECIMAL_Inf 0x78 /* 0 11110 00 Infinity */
72 #endif 72 #endif
73 73
74 /* ---------------------------------------------------------------- */ 74 /* ---------------------------------------------------------------- */
75 /* Routines */ 75 /* Routines */
76 /* ---------------------------------------------------------------- */ 76 /* ---------------------------------------------------------------- */
77 77
78 #include "decimal32Symbols.h" 78 #include "decimal32Symbols.h"
79 79
80 /* String conversions */ 80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83
84 /* String conversions */
81 decimal32 * decimal32FromString(decimal32 *, const char *, decContext *); 85 decimal32 * decimal32FromString(decimal32 *, const char *, decContext *);
82 char * decimal32ToString(const decimal32 *, char *); 86 char * decimal32ToString(const decimal32 *, char *);
83 char * decimal32ToEngString(const decimal32 *, char *); 87 char * decimal32ToEngString(const decimal32 *, char *);
84 88
85 /* decNumber conversions */ 89 /* decNumber conversions */
86 decimal32 * decimal32FromNumber(decimal32 *, const decNumber *, 90 decimal32 * decimal32FromNumber(decimal32 *, const decNumber *,
87 decContext *); 91 decContext *);
88 decNumber * decimal32ToNumber(const decimal32 *, decNumber *); 92 decNumber * decimal32ToNumber(const decimal32 *, decNumber *);
89 93
90 /* Format-dependent utilities */ 94 /* Format-dependent utilities */
91 uint32_t decimal32IsCanonical(const decimal32 *); 95 uint32_t decimal32IsCanonical(const decimal32 *);
92 decimal32 * decimal32Canonical(decimal32 *, const decimal32 *); 96 decimal32 * decimal32Canonical(decimal32 *, const decimal32 *);
93 97
98 #ifdef __cplusplus
99 }
100 #endif
101
94 #endif 102 #endif