@@ -21,7 +21,7 @@ static void pd_scale( pd_t *n )
21
21
n -> v_ = neg ? - v : v ;
22
22
}
23
23
24
- static void pd_adjust ( pd_t * n , int e , const uint64_t * p )
24
+ static void pd_adjust ( pd_t * n , int e , const int64_t * p )
25
25
{
26
26
int neg = n -> v_ < 0L ;
27
27
uint64_t v = neg ?- n -> v_ :n -> v_ ;
@@ -52,7 +52,7 @@ static void pd_div( pd_t *r, pd_t *n1, pd_t *n2 )
52
52
pd_scale ( r );
53
53
}
54
54
55
- static void pd_add ( pd_t * r , pd_t * n1 , pd_t * n2 , const uint64_t * p )
55
+ static void pd_add ( pd_t * r , pd_t * n1 , pd_t * n2 , const int64_t * p )
56
56
{
57
57
int d = n1 -> e_ - n2 -> e_ ;
58
58
if ( d == 0 ) {
@@ -78,7 +78,7 @@ static void pd_add( pd_t *r, pd_t *n1, pd_t *n2, const uint64_t *p )
78
78
pd_scale ( r );
79
79
}
80
80
81
- static void pd_sub ( pd_t * r , pd_t * n1 , pd_t * n2 , const uint64_t * p )
81
+ static void pd_sub ( pd_t * r , pd_t * n1 , pd_t * n2 , const int64_t * p )
82
82
{
83
83
int d = n1 -> e_ - n2 -> e_ ;
84
84
if ( d == 0 ) {
@@ -104,21 +104,21 @@ static void pd_sub( pd_t *r, pd_t *n1, pd_t *n2, const uint64_t *p )
104
104
pd_scale ( r );
105
105
}
106
106
107
- static int pd_lt ( pd_t * n1 , pd_t * n2 , const uint64_t * p )
107
+ static int pd_lt ( pd_t * n1 , pd_t * n2 , const int64_t * p )
108
108
{
109
109
pd_t r [1 ];
110
110
pd_sub ( r , n1 , n2 , p );
111
111
return r -> v_ < 0L ;
112
112
}
113
113
114
- static int pd_gt ( pd_t * n1 , pd_t * n2 , const uint64_t * p )
114
+ static int pd_gt ( pd_t * n1 , pd_t * n2 , const int64_t * p )
115
115
{
116
116
pd_t r [1 ];
117
117
pd_sub ( r , n1 , n2 , p );
118
118
return r -> v_ > 0L ;
119
119
}
120
120
121
- static void pd_sqrt ( pd_t * r , pd_t * val , const uint64_t * f )
121
+ static void pd_sqrt ( pd_t * r , pd_t * val , const int64_t * f )
122
122
{
123
123
pd_t t [1 ], x [1 ], hlf [1 ];
124
124
pd_set ( t , val );
@@ -144,52 +144,52 @@ static pc_qset_t *qset_new( int expo )
144
144
pc_qset_t * qs = (pc_qset_t * )PC_HEAP_START ;
145
145
146
146
// sqrt of numbers 1 to 25 for decaying conf. interval based on slot delay
147
- qs -> decay_ [0 ] = 1000000000UL ;
148
- qs -> decay_ [1 ] = 1000000000UL ;
149
- qs -> decay_ [2 ] = 1414213562UL ;
150
- qs -> decay_ [3 ] = 1732050807UL ;
151
- qs -> decay_ [4 ] = 2000000000UL ;
152
- qs -> decay_ [5 ] = 2236067977UL ;
153
- qs -> decay_ [6 ] = 2449489742UL ;
154
- qs -> decay_ [7 ] = 2645751311UL ;
155
- qs -> decay_ [8 ] = 2828427124UL ;
156
- qs -> decay_ [9 ] = 3000000000UL ;
157
- qs -> decay_ [10 ] = 3162277660UL ;
158
- qs -> decay_ [11 ] = 3316624790UL ;
159
- qs -> decay_ [12 ] = 3464101615UL ;
160
- qs -> decay_ [13 ] = 3605551275UL ;
161
- qs -> decay_ [14 ] = 3741657386UL ;
162
- qs -> decay_ [15 ] = 3872983346UL ;
163
- qs -> decay_ [16 ] = 4000000000UL ;
164
- qs -> decay_ [17 ] = 4123105625UL ;
165
- qs -> decay_ [18 ] = 4242640687UL ;
166
- qs -> decay_ [19 ] = 4358898943UL ;
167
- qs -> decay_ [20 ] = 4472135954UL ;
168
- qs -> decay_ [21 ] = 4582575694UL ;
169
- qs -> decay_ [22 ] = 4690415759UL ;
170
- qs -> decay_ [23 ] = 4795831523UL ;
171
- qs -> decay_ [24 ] = 4898979485UL ;
172
- qs -> decay_ [25 ] = 5000000000UL ;
147
+ qs -> decay_ [0 ] = 1000000000L ;
148
+ qs -> decay_ [1 ] = 1000000000L ;
149
+ qs -> decay_ [2 ] = 1414213562L ;
150
+ qs -> decay_ [3 ] = 1732050807L ;
151
+ qs -> decay_ [4 ] = 2000000000L ;
152
+ qs -> decay_ [5 ] = 2236067977L ;
153
+ qs -> decay_ [6 ] = 2449489742L ;
154
+ qs -> decay_ [7 ] = 2645751311L ;
155
+ qs -> decay_ [8 ] = 2828427124L ;
156
+ qs -> decay_ [9 ] = 3000000000L ;
157
+ qs -> decay_ [10 ] = 3162277660L ;
158
+ qs -> decay_ [11 ] = 3316624790L ;
159
+ qs -> decay_ [12 ] = 3464101615L ;
160
+ qs -> decay_ [13 ] = 3605551275L ;
161
+ qs -> decay_ [14 ] = 3741657386L ;
162
+ qs -> decay_ [15 ] = 3872983346L ;
163
+ qs -> decay_ [16 ] = 4000000000L ;
164
+ qs -> decay_ [17 ] = 4123105625L ;
165
+ qs -> decay_ [18 ] = 4242640687L ;
166
+ qs -> decay_ [19 ] = 4358898943L ;
167
+ qs -> decay_ [20 ] = 4472135954L ;
168
+ qs -> decay_ [21 ] = 4582575694L ;
169
+ qs -> decay_ [22 ] = 4690415759L ;
170
+ qs -> decay_ [23 ] = 4795831523L ;
171
+ qs -> decay_ [24 ] = 4898979485L ;
172
+ qs -> decay_ [25 ] = 5000000000L ;
173
173
174
174
// powers of 10 for use in decimal arithmetic scaling
175
- qs -> fact_ [0 ] = 1UL ;
176
- qs -> fact_ [1 ] = 10UL ;
177
- qs -> fact_ [2 ] = 100UL ;
178
- qs -> fact_ [3 ] = 1000UL ;
179
- qs -> fact_ [4 ] = 10000UL ;
180
- qs -> fact_ [5 ] = 100000UL ;
181
- qs -> fact_ [6 ] = 1000000UL ;
182
- qs -> fact_ [7 ] = 10000000UL ;
183
- qs -> fact_ [8 ] = 100000000UL ;
184
- qs -> fact_ [9 ] = 1000000000UL ;
185
- qs -> fact_ [10 ] = 10000000000UL ;
186
- qs -> fact_ [11 ] = 100000000000UL ;
187
- qs -> fact_ [12 ] = 1000000000000UL ;
188
- qs -> fact_ [13 ] = 10000000000000UL ;
189
- qs -> fact_ [14 ] = 100000000000000UL ;
190
- qs -> fact_ [15 ] = 1000000000000000UL ;
191
- qs -> fact_ [16 ] = 10000000000000000UL ;
192
- qs -> fact_ [17 ] = 100000000000000000UL ;
175
+ qs -> fact_ [0 ] = 1L ;
176
+ qs -> fact_ [1 ] = 10L ;
177
+ qs -> fact_ [2 ] = 100L ;
178
+ qs -> fact_ [3 ] = 1000L ;
179
+ qs -> fact_ [4 ] = 10000L ;
180
+ qs -> fact_ [5 ] = 100000L ;
181
+ qs -> fact_ [6 ] = 1000000L ;
182
+ qs -> fact_ [7 ] = 10000000L ;
183
+ qs -> fact_ [8 ] = 100000000L ;
184
+ qs -> fact_ [9 ] = 1000000000L ;
185
+ qs -> fact_ [10 ] = 10000000000L ;
186
+ qs -> fact_ [11 ] = 100000000000L ;
187
+ qs -> fact_ [12 ] = 1000000000000L ;
188
+ qs -> fact_ [13 ] = 10000000000000L ;
189
+ qs -> fact_ [14 ] = 100000000000000L ;
190
+ qs -> fact_ [15 ] = 1000000000000000L ;
191
+ qs -> fact_ [16 ] = 10000000000000000L ;
192
+ qs -> fact_ [17 ] = 100000000000000000L ;
193
193
194
194
qs -> num_ = 0 ;
195
195
qs -> expo_ = expo ;
0 commit comments