27 |
#include "num_include.h" |
#include "num_include.h" |
28 |
|
|
29 |
|
|
30 |
number_zerop(x) |
int |
31 |
object x; |
number_zerop(object x) |
32 |
{ |
{ |
33 |
switch (type_of(x)) { |
switch (type_of(x)) { |
34 |
|
|
60 |
|
|
61 |
default: |
default: |
62 |
FEwrong_type_argument(sLnumber, x); |
FEwrong_type_argument(sLnumber, x); |
63 |
|
return(0); |
64 |
} |
} |
65 |
} |
} |
66 |
|
|
67 |
number_plusp(x) |
int |
68 |
object x; |
number_plusp(object x) |
69 |
{ |
{ |
70 |
switch (type_of(x)) { |
switch (type_of(x)) { |
71 |
|
|
101 |
|
|
102 |
default: |
default: |
103 |
FEwrong_type_argument(TSor_rational_float,x); |
FEwrong_type_argument(TSor_rational_float,x); |
104 |
|
return(0); |
105 |
} |
} |
106 |
} |
} |
107 |
|
|
108 |
number_minusp(x) |
int |
109 |
object x; |
number_minusp(object x) |
110 |
{ |
{ |
111 |
switch (type_of(x)) { |
switch (type_of(x)) { |
112 |
|
|
142 |
|
|
143 |
default: |
default: |
144 |
FEwrong_type_argument(TSor_rational_float,x); |
FEwrong_type_argument(TSor_rational_float,x); |
145 |
|
return(0); |
146 |
} |
} |
147 |
} |
} |
148 |
|
|
149 |
number_oddp(x) |
int |
150 |
object x; |
number_oddp(object x) |
151 |
{ |
{ |
152 |
int i; |
int i=0; |
153 |
|
|
154 |
if (type_of(x) == t_fixnum) |
if (type_of(x) == t_fixnum) |
155 |
i = fix(x); |
i = fix(x); |
160 |
return(i & 1); |
return(i & 1); |
161 |
} |
} |
162 |
|
|
163 |
number_evenp(x) |
int |
164 |
object x; |
number_evenp(object x) |
165 |
{ |
{ |
166 |
int i; |
int i=0; |
167 |
|
|
168 |
if (type_of(x) == t_fixnum) |
if (type_of(x) == t_fixnum) |
169 |
i = fix(x); |
i = fix(x); |
174 |
return(~i & 1); |
return(~i & 1); |
175 |
} |
} |
176 |
|
|
177 |
Lzerop() |
void |
178 |
|
Lzerop(void) |
179 |
{ |
{ |
180 |
check_arg(1); |
check_arg(1); |
181 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
185 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
186 |
} |
} |
187 |
|
|
188 |
Lplusp() |
void |
189 |
|
Lplusp(void) |
190 |
{ |
{ |
191 |
check_arg(1); |
check_arg(1); |
192 |
check_type_or_rational_float(&vs_base[0]); |
check_type_or_rational_float(&vs_base[0]); |
196 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
197 |
} |
} |
198 |
|
|
199 |
Lminusp() |
void |
200 |
|
Lminusp(void) |
201 |
{ |
{ |
202 |
check_arg(1); |
check_arg(1); |
203 |
check_type_or_rational_float(&vs_base[0]); |
check_type_or_rational_float(&vs_base[0]); |
207 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
208 |
} |
} |
209 |
|
|
210 |
Loddp() |
void |
211 |
|
Loddp(void) |
212 |
{ |
{ |
213 |
check_arg(1); |
check_arg(1); |
214 |
check_type_integer(&vs_base[0]); |
check_type_integer(&vs_base[0]); |
218 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
219 |
} |
} |
220 |
|
|
221 |
Levenp() |
void |
222 |
|
Levenp(void) |
223 |
{ |
{ |
224 |
check_arg(1); |
check_arg(1); |
225 |
check_type_integer(&vs_base[0]); |
check_type_integer(&vs_base[0]); |
230 |
} |
} |
231 |
|
|
232 |
/* this is just to force things into memory in num_co.c */ |
/* this is just to force things into memory in num_co.c */ |
233 |
void _assure_in_memory (p) |
void _assure_in_memory (void *p) |
|
void *p; |
|
234 |
{ |
{ |
235 |
; |
; |
236 |
} |
} |
237 |
|
|
238 |
int |
int |
239 |
lf_eqlp(p,q) |
lf_eqlp(double *p, double *q) |
|
double *p,*q; |
|
240 |
{ |
{ |
241 |
return *p == *q; |
return *p == *q; |
242 |
} |
} |
243 |
|
|
244 |
|
|
245 |
init_num_pred() |
void |
246 |
|
init_num_pred(void) |
247 |
{ |
{ |
248 |
#ifndef GMP |
#ifndef GMP |
249 |
big_register_1 = new_bignum(); |
big_register_1 = new_bignum(); |