199 |
return(i); |
return(i); |
200 |
} |
} |
201 |
|
|
202 |
/* static float */ |
float |
203 |
/* object_to_float(object x) */ |
object_to_float(object x) |
204 |
/* { */ |
{ |
205 |
/* float f=0.0; */ |
float f=0.0; |
206 |
|
|
207 |
/* switch (type_of(x)) { */ |
switch (type_of(x)) { |
208 |
/* case t_character: */ |
case t_character: |
209 |
/* f = char_code(x); break; */ |
f = char_code(x); break; |
210 |
/* case t_fixnum: */ |
case t_fixnum: |
211 |
/* f = fix(x); break; */ |
f = fix(x); break; |
212 |
/* case t_bignum: */ |
case t_bignum: |
213 |
/* case t_ratio: */ |
case t_ratio: |
214 |
/* f = number_to_double(x); break; */ |
f = number_to_double(x); break; |
215 |
/* case t_shortfloat: */ |
case t_shortfloat: |
216 |
/* f = sf(x); break; */ |
f = sf(x); break; |
217 |
/* case t_longfloat: */ |
case t_longfloat: |
218 |
/* f = lf(x); break; */ |
f = lf(x); break; |
219 |
/* default: */ |
default: |
220 |
/* FEerror("~S cannot be coerce to a C float.", 1, x); */ |
FEerror("~S cannot be coerce to a C float.", 1, x); |
221 |
/* } */ |
} |
222 |
/* return(f); */ |
return(f); |
223 |
/* } */ |
} |
224 |
|
|
225 |
/* static double */ |
double |
226 |
/* object_to_double(object x) */ |
object_to_double(object x) |
227 |
/* { */ |
{ |
228 |
/* double d=0.0; */ |
double d=0.0; |
229 |
|
|
230 |
/* switch (type_of(x)) { */ |
switch (type_of(x)) { |
231 |
/* case t_character: */ |
case t_character: |
232 |
/* d = char_code(x); break; */ |
d = char_code(x); break; |
233 |
/* case t_fixnum: */ |
case t_fixnum: |
234 |
/* d = fix(x); break; */ |
d = fix(x); break; |
235 |
/* case t_bignum: */ |
case t_bignum: |
236 |
/* case t_ratio: */ |
case t_ratio: |
237 |
/* d = number_to_double(x); break; */ |
d = number_to_double(x); break; |
238 |
/* case t_shortfloat: */ |
case t_shortfloat: |
239 |
/* d = sf(x); break; */ |
d = sf(x); break; |
240 |
/* case t_longfloat: */ |
case t_longfloat: |
241 |
/* d = lf(x); break; */ |
d = lf(x); break; |
242 |
/* default: */ |
default: |
243 |
/* FEerror("~S cannot be coerce to a C double.", 1, x); */ |
FEerror("~S cannot be coerce to a C double.", 1, x); |
244 |
/* } */ |
} |
245 |
/* return(d); */ |
return(d); |
246 |
/* } */ |
} |
247 |
|
|
248 |
/* this may allocate storage. The user can prevent this |
/* this may allocate storage. The user can prevent this |
249 |
by providing a string will fillpointer < length and |
by providing a string will fillpointer < length and |