diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:24 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:24 -0800 |
commit | 1edcb9b62a1a520eddae8403c19d841c9b18737f (patch) | |
tree | bc0a43d9b3905726a76ed6f0528b54275f23d082 /scl.c | |
parent | 5ca6e8e6a4e5c022a6fb5d28f30219c22c99eda8 (diff) | |
download | scm-1edcb9b62a1a520eddae8403c19d841c9b18737f.tar.gz scm-1edcb9b62a1a520eddae8403c19d841c9b18737f.zip |
Import Upstream version 5b3upstream/5b3
Diffstat (limited to 'scl.c')
-rw-r--r-- | scl.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -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}, |