From 1edcb9b62a1a520eddae8403c19d841c9b18737f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:24 -0800 Subject: Import Upstream version 5b3 --- scl.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'scl.c') 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}, -- cgit v1.2.3