author | Camm Maguire <camm@debian.org> | 2003年06月02日 17:23:53 +0000 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2003年06月02日 17:23:53 +0000 |
commit | e03ccf7b12fd2ae6182f1e4cfc46d24211757d20 (patch) | |
tree | 4cba3ecf72814f29c08d4d04ec3bfaad1185c87d | |
parent | d5a34247d84d84258510c04e12e359ffbfb6410b (diff) | |
download | gcl-unlabeled-1.15.6.1.2.1.2.tar.gz |
-rwxr-xr-x | gcl/o/cmpaux.c | 90 |
diff --git a/gcl/o/cmpaux.c b/gcl/o/cmpaux.c index 88dcf0d6d..0641536fc 100755 --- a/gcl/o/cmpaux.c +++ b/gcl/o/cmpaux.c @@ -199,51 +199,51 @@ object_to_int(object x) return(i); } -/* static float */ -/* object_to_float(object x) */ -/* { */ -/* float f=0.0; */ - -/* switch (type_of(x)) { */ -/* case t_character: */ -/* f = char_code(x); break; */ -/* case t_fixnum: */ -/* f = fix(x); break; */ -/* case t_bignum: */ -/* case t_ratio: */ -/* f = number_to_double(x); break; */ -/* case t_shortfloat: */ -/* f = sf(x); break; */ -/* case t_longfloat: */ -/* f = lf(x); break; */ -/* default: */ -/* FEerror("~S cannot be coerce to a C float.", 1, x); */ -/* } */ -/* return(f); */ -/* } */ - -/* static double */ -/* object_to_double(object x) */ -/* { */ -/* double d=0.0; */ - -/* switch (type_of(x)) { */ -/* case t_character: */ -/* d = char_code(x); break; */ -/* case t_fixnum: */ -/* d = fix(x); break; */ -/* case t_bignum: */ -/* case t_ratio: */ -/* d = number_to_double(x); break; */ -/* case t_shortfloat: */ -/* d = sf(x); break; */ -/* case t_longfloat: */ -/* d = lf(x); break; */ -/* default: */ -/* FEerror("~S cannot be coerce to a C double.", 1, x); */ -/* } */ -/* return(d); */ -/* } */ +float +object_to_float(object x) +{ + float f=0.0; + + switch (type_of(x)) { + case t_character: + f = char_code(x); break; + case t_fixnum: + f = fix(x); break; + case t_bignum: + case t_ratio: + f = number_to_double(x); break; + case t_shortfloat: + f = sf(x); break; + case t_longfloat: + f = lf(x); break; + default: + FEerror("~S cannot be coerce to a C float.", 1, x); + } + return(f); +} + +double +object_to_double(object x) +{ + double d=0.0; + + switch (type_of(x)) { + case t_character: + d = char_code(x); break; + case t_fixnum: + d = fix(x); break; + case t_bignum: + case t_ratio: + d = number_to_double(x); break; + case t_shortfloat: + d = sf(x); break; + case t_longfloat: + d = lf(x); break; + default: + FEerror("~S cannot be coerce to a C double.", 1, x); + } + return(d); +} /* this may allocate storage. The user can prevent this by providing a string will fillpointer < length and |