summaryrefslogtreecommitdiffstats
path: root/contrib/bc/dc/eval.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-02-26 07:13:00 +0000
committerkris <kris@FreeBSD.org>2001-02-26 07:13:00 +0000
commit719baf164e794b772e8b1869bbf106ef68bfd40e (patch)
tree1f4f6cec66b553514b27fc7b72541e0f7adc79e5 /contrib/bc/dc/eval.c
parent9657c835ffcf45e0a6d46f291505b0b112f8a244 (diff)
downloadFreeBSD-src-719baf164e794b772e8b1869bbf106ef68bfd40e.zip
FreeBSD-src-719baf164e794b772e8b1869bbf106ef68bfd40e.tar.gz
Initial import of bc 1.0.6
Diffstat (limited to 'contrib/bc/dc/eval.c')
-rw-r--r--contrib/bc/dc/eval.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/contrib/bc/dc/eval.c b/contrib/bc/dc/eval.c
index 0cb2185..21592d9 100644
--- a/contrib/bc/dc/eval.c
+++ b/contrib/bc/dc/eval.c
@@ -1,7 +1,7 @@
/*
* evaluate the dc language, from a FILE* or a string
*
- * Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1997, 1998, 2000 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
@@ -15,8 +15,10 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can either send email to this
- * program's author (see below) or write to: The Free Software Foundation,
- * Inc.; 675 Mass Ave. Cambridge, MA 02139, USA.
+ * program's author (see below) or write to:
+ * The Free Software Foundation, Inc.
+ * 59 Temple Place, Suite 330
+ * Boston, MA 02111 USA
*/
/* This is the only module which knows about the dc input language */
@@ -185,12 +187,13 @@ dc_func DC_DECLARG((c, peekc, negcmp))
case '|':
/* Consider the top three elements of the stack as (base, exp, mod),
* where mod is top-of-stack, exp is next-to-top, and base is
- * second-from-top. Mod must be non-zero and exp must be a
- * non-negative integer. Push the result of raising base to the exp
- * power, reduced modulo mod. If we had base in register b, exp in
- * register e, and mod in register m then this is conceptually
- * equivalent to "lble^lm%", but it is implemented in a more efficient
- * manner, and can handle arbritrarily large values for exp.
+ * second-from-top. Mod must be non-zero, exp must be non-negative,
+ * and all three must be integers. Push the result of raising
+ * base to the exp power, reduced modulo mod. If we had base in
+ * register b, exp in register e, and mod in register m then this
+ * is conceptually equivalent to "lble^lm%", but it is implemented
+ * in a more efficient manner, and can handle arbritrarily large
+ * values for exp.
*/
dc_triop(dc_modexp, dc_scale);
break;
@@ -633,7 +636,7 @@ dc_evalfile DC_DECLARG((fp))
break;
case DC_QUIT:
if (unwind_noexit != DC_TRUE)
- return DC_FAIL;
+ return DC_SUCCESS;
fprintf(stderr,
"%s: Q command argument exceeded string execution depth\n",
progname);
OpenPOWER on IntegriCloud