summaryrefslogtreecommitdiffstats
path: root/scl.c
diff options
context:
space:
mode:
Diffstat (limited to 'scl.c')
-rw-r--r--scl.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/scl.c b/scl.c
index 393d0f0..8e89bd8 100644
--- a/scl.c
+++ b/scl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -291,11 +291,13 @@ int floprint(sexp, port, writing)
int writing;
{
#ifdef FLOATS
- char num_buf[FLOBUFLEN];
- lfwrite(num_buf, (sizet)sizeof(char), iflo2str(sexp, num_buf), port);
-#else
- ipruk("float", sexp, port);
+ if (!errjmp_bad) {
+ char num_buf[FLOBUFLEN];
+ lfwrite(num_buf, (sizet)sizeof(char), iflo2str(sexp, num_buf), port);
+ return !0;
+ } else
#endif
+ ipruk("float", sexp, port);
return !0;
}
int bigprint(exp, port, writing)
@@ -304,11 +306,13 @@ int bigprint(exp, port, writing)
int writing;
{
#ifdef BIGDIG
- exp = big2str(exp, (unsigned int)10);
- lfwrite(CHARS(exp), (sizet)sizeof(char), (sizet)LENGTH(exp), port);
-#else
- ipruk("bignum", exp, port);
+ if (!errjmp_bad) {
+ exp = big2str(exp, (unsigned int)10);
+ lfwrite(CHARS(exp), (sizet)sizeof(char), (sizet)LENGTH(exp), port);
+ return !0;
+ } else
#endif
+ ipruk("bignum", exp, port);
return !0;
}
/*** END nums->strs ***/
@@ -588,6 +592,7 @@ SCM istr2flo(str, len, radix)
case '@': { /* polar input for complex number */
/* get a `real' for angle */
second = istr2flo(&str[i], (long)(len-i), radix);
+ if IMP(second) return BOOL_F;
if (!(INEXP(second))) return BOOL_F; /* not `real' */
if (CPLXP(second)) return BOOL_F; /* not `real' */
tmp = REALPART(second);
@@ -602,6 +607,7 @@ SCM istr2flo(str, len, radix)
if (i==(len-1)) return makdbl(res, lead_sgn);
/* get a `ureal' for complex part */
second = istr2flo(&str[i], (long)((len-i)-1), radix);
+ if IMP(second) return BOOL_F;
if (!(INEXP(second))) return BOOL_F; /* not `ureal' */
if (CPLXP(second)) return BOOL_F; /* not `ureal' */
tmp = REALPART(second);
@@ -863,7 +869,6 @@ SCM equal(x, y)
else return BOOL_F;
}
}
- return BOOL_F;
}
SCM numberp(x)
@@ -2328,6 +2333,7 @@ static dblproc cxrs[] = {
{"$abs", fabs},
{"$exp", exp},
{"$log", log},
+ {"$log10", log10},
{"$sin", sin},
{"$cos", cos},
{"$tan", tan},