Compare commits

...

6 Commits

Author SHA1 Message Date
Landon Curt Noll
ae2a752314 Release calc version 2.11.3t0 2017-05-21 15:38:38 -07:00
Landon Curt Noll
61dd47526f Release calc version 2.11.2t1.0 2017-05-21 15:38:38 -07:00
Landon Curt Noll
417ffb6ab5 Release calc version 2.11.1t2.1 2017-05-21 15:38:37 -07:00
Landon Curt Noll
121b8f72c6 Release calc version 2.11.1t3.0 2017-05-21 15:38:37 -07:00
Landon Curt Noll
9968a69f50 Release calc version 2.11.1t3 2017-05-21 15:38:37 -07:00
Landon Curt Noll
1ea579d929 Release calc version 2.11.1t2.2 2017-05-21 15:38:37 -07:00
499 changed files with 5163 additions and 3657 deletions

22
BUGS
View File

@@ -20,20 +20,21 @@ configuration, try backing them out and see if things get better.
To be sure that your version of calc is up to date, check out: To be sure that your version of calc is up to date, check out:
http://reality.sgi.com/chongo/tech/comp/calc/calc-download.html http://www.isthe.com/chongo/tech/comp/calc/calc-download.html
The calc web site is located at: The calc web site is located at:
http://reality.sgi.com/chongo/tech/comp/calc/index.html http://www.isthe.com/chongo/tech/comp/calc/index.html
=-= =-=
If you have tried all of the above and things still are not right, If you have tried all of the above and things still are not right,
then it may be time to send in a bug report. You can send bug reports to: then it may be time to send in a bug report. You can send bug reports to:
calc-bugs at postofc dot corp dot sgi dot com calc-bugs at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe', the web site URL uses 'isthe' ]]
When you send your report, please include the following information: When you send your report, please include the following information:
@@ -58,9 +59,10 @@ Stack traces from core dumps are useful to send as well.
Send any comments, compiler warning messages, suggestions and most Send any comments, compiler warning messages, suggestions and most
importantly, fixes (in the form of a context diff patch) to: importantly, fixes (in the form of a context diff patch) to:
calc-tester at postofc dot corp dot sgi dot com calc-bugs at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe', the web site URL uses 'isthe' ]]
You should use the above calc-bugs address for bug reports, if you are You should use the above calc-bugs address for bug reports, if you are
not currently a member of the calc-tester mailing list. not currently a member of the calc-tester mailing list.
@@ -177,12 +179,12 @@ Problems with known work-a-rounds:
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.4 $ ## @(#) $Revision: 29.5 $
## @(#) $Id: BUGS,v 29.4 1999/12/15 09:13:29 chongo Exp $ ## @(#) $Id: BUGS,v 29.5 2000/06/07 14:02:13 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $
## ##
## Under source code control: 1994/03/18 14:06:13 ## Under source code control: 1994/03/18 14:06:13
## File existed as early as: 1994 ## File existed as early as: 1994
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

583
CHANGES

File diff suppressed because it is too large Load Diff

30
COPYING
View File

@@ -12,8 +12,8 @@ This file is Copyrighted
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: COPYING,v 29.1 1999/12/14 09:15:29 chongo Exp $ # @(#) $Id: COPYING,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/COPYING,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/COPYING,v $
=-= =-=
@@ -55,16 +55,28 @@ Calc is covered by the GNU Lesser General Public License
The contact addresses for calc is as follows: The contact addresses for calc is as follows:
Web: http://reality.sgi.com/chongo/tech/comp/calc/index.html Web: http://www.isthe.com/chongo/tech/comp/calc/index.html
http://www.isthe.com/chongo/tech/comp/calc/index.html EMail: calc-contrib at asthe dot com
EMail: calc-tester at postofc dot corp dot sgi dot com To join the calc-tester mailing list. Send a request to:
calc-tester at isthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove spaces ]] calc-tester-request at asthe dot com
The 2nd address set is provided in case the 1st address set no Your message body (not the subject) should consist of:
longer functions.
subscribe calc-tester address
end
name your_full_name
where ``address'' is your EMail address and ``your_full_name'' is
your full name.
Calc bug reports, however should be sent to:
calc-bugs at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
=-= =-=

View File

@@ -65,12 +65,12 @@ the calc help subsystem. See the README file for details.
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: HOWTO.INSTALL,v 29.1 1999/12/14 09:15:29 chongo Exp $ ## @(#) $Id: HOWTO.INSTALL,v 29.2 2000/06/07 14:02:13 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $
## ##
## Under source code control: 1999/09/27 20:48:44 ## Under source code control: 1999/09/27 20:48:44
## File existed as early as: 1999 ## File existed as early as: 1999
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -471,12 +471,12 @@ need call libcalc_call_me_last() only once.
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: LIBRARY,v 29.1 1999/12/14 09:15:29 chongo Exp $ ## @(#) $Id: LIBRARY,v 29.2 2000/06/07 14:02:13 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $
## ##
## Under source code control: 1993/07/30 19:44:49 ## Under source code control: 1993/07/30 19:44:49
## File existed as early as: 1993 ## File existed as early as: 1993
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -20,15 +20,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.5 $ # @(#) $Revision: 29.9 $
# @(#) $Id: Makefile.ship,v 29.5 1999/12/17 09:07:35 chongo Exp $ # @(#) $Id: Makefile.ship,v 29.9 2000/06/07 15:50:19 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $
# #
# Under source code control: 1990/02/15 01:48:41 # Under source code control: 1990/02/15 01:48:41
# File existed as early as: before 1990 # File existed as early as: before 1990
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
# calculator by David I. Bell with help/mods from others # calculator by David I. Bell with help/mods from others
# Makefile by Landon Curt Noll # Makefile by Landon Curt Noll
@@ -2084,7 +2084,7 @@ have_urandom.h: ${MAKE_FILE}
${Q}echo '' >> have_urandom.h ${Q}echo '' >> have_urandom.h
${Q}echo '' >> have_urandom.h ${Q}echo '' >> have_urandom.h
${Q}echo '/* do we have /dev/urandom? */' >> have_urandom.h ${Q}echo '/* do we have /dev/urandom? */' >> have_urandom.h
-${Q}if [ -c /dev/urandom ]; then \ -${Q}if [ -e /dev/urandom ] 2>/dev/null; then \
echo '#define HAVE_URANDOM_H /* yes */' >> have_urandom.h; \ echo '#define HAVE_URANDOM_H /* yes */' >> have_urandom.h; \
else \ else \
echo '#undef HAVE_URANDOM_H /* no */' >> have_urandom.h; \ echo '#undef HAVE_URANDOM_H /* no */' >> have_urandom.h; \
@@ -2397,7 +2397,11 @@ sample/sample:
status="$$?"; \ status="$$?"; \
if [ "$$status" -ne 0 ]; then \ if [ "$$status" -ne 0 ]; then \
echo "$$status" > ../.sample_error; \ echo "$$status" > ../.sample_error; \
else \
true ; \
fi; \ fi; \
else \
true ; \
fi fi
${Q}if [ -f .sample_error ]; then \ ${Q}if [ -f .sample_error ]; then \
echo "sample make failed, code: `cat .sample_error`" 1>&2; \ echo "sample make failed, code: `cat .sample_error`" 1>&2; \
@@ -3316,6 +3320,7 @@ func.o: have_malloc.h
func.o: have_memmv.h func.o: have_memmv.h
func.o: have_newstr.h func.o: have_newstr.h
func.o: have_stdlib.h func.o: have_stdlib.h
func.o: have_strdup.h
func.o: have_string.h func.o: have_string.h
func.o: have_times.h func.o: have_times.h
func.o: have_unistd.h func.o: have_unistd.h

22
README
View File

@@ -4,7 +4,7 @@ See the HOWTO.INSTALL file for information on how to build and install calc.
To be sure that your version of calc is up to date, check out: To be sure that your version of calc is up to date, check out:
http://reality.sgi.com/chongo/tech/comp/calc/calc-download.html http://www.isthe.com/chongo/tech/comp/calc/calc-download.html
We are interested in any/all feedback on recent versions of calc. We are interested in any/all feedback on recent versions of calc.
In particular we would like to hear about: In particular we would like to hear about:
@@ -75,9 +75,10 @@ for a wish/todo list. Code contributions are welcome.
To join the calc-tester mailing list. Send a request to: To join the calc-tester mailing list. Send a request to:
calc-tester-request at postofc dot corp dot sgi dot com calc-tester-request at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
Your message body (not the subject) should consist of: Your message body (not the subject) should consist of:
@@ -90,15 +91,16 @@ your full name.
Calc bug reports, however should be sent to: Calc bug reports, however should be sent to:
calc-bugs at postofc dot corp dot sgi dot com calc-bugs at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
but see the BUGS file first. but see the BUGS file first.
The calc web site is located at: The calc web site is located at:
http://reality.sgi.com/chongo/tech/comp/calc/ http://www.isthe.com/chongo/tech/comp/calc/
## Copyright (C) 1999 Landon Curt Noll ## Copyright (C) 1999 Landon Curt Noll
## ##
@@ -116,12 +118,12 @@ The calc web site is located at:
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: README,v 29.1 1999/12/14 09:15:29 chongo Exp $ ## @(#) $Id: README,v 29.2 2000/06/07 14:02:13 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/README,v $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/README,v $
## ##
## Under source code control: 1995/10/25 05:27:59 ## Under source code control: 1995/10/25 05:27:59
## File existed as early as: 1995 ## File existed as early as: 1995
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

10
addop.c
View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: addop.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: addop.c,v 29.2 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/addop.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/addop.c,v $
* *
* Under source code control: 1990/02/15 01:48:10 * Under source code control: 1990/02/15 01:48:10
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -208,7 +208,7 @@ endfunc(void)
memcpy((char *) fp, (char *) curfunc, size); memcpy((char *) fp, (char *) curfunc, size);
if (curfunc != functemplate) if (curfunc != functemplate)
free(curfunc); free(curfunc);
if (conf->traceflags & TRACE_FNCODES) { if (newname[0] != '*' && (conf->traceflags & TRACE_FNCODES)) {
dumpnames = TRUE; dumpnames = TRUE;
for (size = 0; size < fp->f_opcodecount; ) { for (size = 0; size < fp->f_opcodecount; ) {
printf("%ld: ", (long)size); printf("%ld: ", (long)size);
@@ -318,7 +318,7 @@ freefunc(FUNC *fp)
/*NOTREACHED*/ /*NOTREACHED*/
} }
} }
if (conf->traceflags & TRACE_FNCODES) { if (newname[0] != '*' && (conf->traceflags & TRACE_FNCODES)) {
printf("Freeing function \"%s\"\n",namestr(&funcnames,index)); printf("Freeing function \"%s\"\n",namestr(&funcnames,index));
dumpnames = FALSE; dumpnames = FALSE;
for (i = 0; i < fp->f_opcodecount; ) { for (i = 0; i < fp->f_opcodecount; ) {

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: align32.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: align32.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/align32.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/align32.c,v $
* *
* Under source code control: 1995/11/23 05:18:06 * Under source code control: 1995/11/23 05:18:06
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: alloc.h,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: alloc.h,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $
* *
* Under source code control: 1990/02/15 01:48:29 * Under source code control: 1990/02/15 01:48:29
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: assocfunc.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: assocfunc.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/assocfunc.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/assocfunc.c,v $
* *
* Under source code control: 1993/07/20 23:04:27 * Under source code control: 1993/07/20 23:04:27
* File existed as early as: 1993 * File existed as early as: 1993
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: blkcpy.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: blkcpy.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.c,v $
* *
* Under source code control: 1997/04/18 20:41:26 * Under source code control: 1997/04/18 20:41:26
* File existed as early as: 1997 * File existed as early as: 1997
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: blkcpy.h,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: blkcpy.h,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.h,v $
* *
* Under source code control: 1997/04/18 20:41:25 * Under source code control: 1997/04/18 20:41:25
* File existed as early as: 1997 * File existed as early as: 1997
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,15 +19,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: block.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ * @(#) $Id: block.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/block.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.c,v $
* *
* Under source code control: 1997/02/27 00:29:40 * Under source code control: 1997/02/27 00:29:40
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,15 +19,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: block.h,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: block.h,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/block.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.h,v $
* *
* Under source code control: 1997/02/21 05:03:39 * Under source code control: 1997/02/21 05:03:39
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: byteswap.c,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: byteswap.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.c,v $
* *
* Under source code control: 1995/10/11 04:44:01 * Under source code control: 1995/10/11 04:44:01
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: byteswap.h,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: byteswap.h,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $
* *
* Under source code control: 1995/10/11 04:44:01 * Under source code control: 1995/10/11 04:44:01
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: Makefile,v 29.1 1999/12/14 09:15:30 chongo Exp $ # @(#) $Id: Makefile,v 29.2 2000/06/07 14:02:25 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $
# #
# Under source code control: 1991/07/21 05:00:54 # Under source code control: 1991/07/21 05:00:54
# File existed as early as: 1991 # File existed as early as: 1991
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
# calculator by David I. Bell with help/mods from others # calculator by David I. Bell with help/mods from others
# Makefile by Landon Curt Noll # Makefile by Landon Curt Noll

View File

@@ -37,9 +37,10 @@ be useful!
If you write something that you think is useful, please send it to: If you write something that you think is useful, please send it to:
calc-tester at postofc dot corp dot sgi dot com calc-contrib at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
By convention, a resource file only defines and/or initializes functions, By convention, a resource file only defines and/or initializes functions,
objects and variables. (The regress.cal and testxxx.cal regression test objects and variables. (The regress.cal and testxxx.cal regression test
@@ -722,12 +723,12 @@ xx_print.cal
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: README,v 29.1 1999/12/14 09:15:30 chongo Exp $ ## @(#) $Id: README,v 29.2 2000/06/07 14:02:25 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $ ## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $
## ##
## Under source code control: 1990/02/15 01:50:32 ## Under source code control: 1990/02/15 01:50:32
## File existed as early as: before 1990 ## File existed as early as: before 1990
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: beer.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: beer.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/beer.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/beer.cal,v $
* *
* Under source code control: 1996/11/13 13:21:05 * Under source code control: 1996/11/13 13:21:05
* File existed as early as: 1996 * File existed as early as: 1996
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: bernoulli.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: bernoulli.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bernoulli.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bernoulli.cal,v $
* *
* Under source code control: 1991/09/30 11:18:41 * Under source code control: 1991/09/30 11:18:41
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: bigprime.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ * @(#) $Id: bigprime.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bigprime.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bigprime.cal,v $
* *
* Under source code control: 1991/05/22 21:56:32 * Under source code control: 1991/05/22 21:56:32
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -16,14 +16,14 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: bindings,v 29.1 1999/12/14 09:15:30 chongo Exp $ # @(#) $Id: bindings,v 29.2 2000/06/07 14:02:25 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bindings,v $ # @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bindings,v $
# #
# Under source code control: 1993/05/02 20:09:19 # Under source code control: 1993/05/02 20:09:19
# File existed as early as: 1993 # File existed as early as: 1993
# #
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# NOTE: This facility is ignored if calc was compiled with GNU-readline. # NOTE: This facility is ignored if calc was compiled with GNU-readline.
# In that case, the standard readline mechanisms (see readline(3)) # In that case, the standard readline mechanisms (see readline(3))

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: chrem.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: chrem.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/chrem.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/chrem.cal,v $
* *
* Under source code control: 1992/09/26 01:00:47 * Under source code control: 1992/09/26 01:00:47
* File existed as early as: 1992 * File existed as early as: 1992
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: deg.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: deg.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/deg.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/deg.cal,v $
* *
* Under source code control: 1990/02/15 01:50:33 * Under source code control: 1990/02/15 01:50:33
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: ellip.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: ellip.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/ellip.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/ellip.cal,v $
* *
* Under source code control: 1990/02/15 01:50:33 * Under source code control: 1990/02/15 01:50:33
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: hello.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: hello.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/hello.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/hello.cal,v $
* *
* Under source code control: 1996/11/13 13:25:43 * Under source code control: 1996/11/13 13:25:43
* File existed as early as: 1996 * File existed as early as: 1996
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: lucas.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: lucas.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $
* *
* Under source code control: 1990/05/03 16:49:51 * Under source code control: 1990/05/03 16:49:51
* File existed as early as: 1990 * File existed as early as: 1990
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: lucas_chk.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: lucas_chk.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_chk.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_chk.cal,v $
* *
* Under source code control: 1991/01/11 05:41:43 * Under source code control: 1991/01/11 05:41:43
* File existed as early as: 1991 * File existed as early as: 1991
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: lucas_tbl.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: lucas_tbl.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_tbl.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_tbl.cal,v $
* *
* Under source code control: 1991/01/26 02:43:43 * Under source code control: 1991/01/26 02:43:43
* File existed as early as: 1991 * File existed as early as: 1991
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: mersenne.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: mersenne.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mersenne.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mersenne.cal,v $
* *
* Under source code control: 1991/05/22 21:56:36 * Under source code control: 1991/05/22 21:56:36
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: mfactor.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: mfactor.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mfactor.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mfactor.cal,v $
* *
* Under source code control: 1996/07/06 06:09:40 * Under source code control: 1996/07/06 06:09:40
* File existed as early as: 1996 * File existed as early as: 1996
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: mod.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: mod.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mod.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mod.cal,v $
* *
* Under source code control: 1990/02/15 01:50:34 * Under source code control: 1990/02/15 01:50:34
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: natnumset.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: natnumset.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/natnumset.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/natnumset.cal,v $
* *
* Under source code control: 1997/09/07 23:53:51 * Under source code control: 1997/09/07 23:53:51
* File existed as early as: 1997 * File existed as early as: 1997
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: pell.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: pell.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pell.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pell.cal,v $
* *
* Under source code control: 1990/02/15 01:50:34 * Under source code control: 1990/02/15 01:50:34
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: pi.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: pi.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pi.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pi.cal,v $
* *
* Under source code control: 1991/05/22 21:56:37 * Under source code control: 1991/05/22 21:56:37
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: pix.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: pix.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pix.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pix.cal,v $
* *
* Under source code control: 1996/07/09 03:14:14 * Under source code control: 1996/07/09 03:14:14
* File existed as early as: 1996 * File existed as early as: 1996
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: pollard.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: pollard.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pollard.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pollard.cal,v $
* *
* Under source code control: 1991/05/22 21:56:37 * Under source code control: 1991/05/22 21:56:37
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: poly.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ * @(#) $Id: poly.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/poly.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/poly.cal,v $
* *
* Under source code control: 1990/02/15 01:50:35 * Under source code control: 1990/02/15 01:50:35
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: prompt.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: prompt.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/prompt.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/prompt.cal,v $
* *
* Under source code control: 1995/12/18 04:43:25 * Under source code control: 1995/12/18 04:43:25
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: psqrt.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: psqrt.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/psqrt.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/psqrt.cal,v $
* *
* Under source code control: 1990/02/15 01:50:35 * Under source code control: 1990/02/15 01:50:35
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -7,15 +7,15 @@
* utc_hr_offset Offset from UTC in hours. * utc_hr_offset Offset from UTC in hours.
* *
* Written by: Klaus Alexander Seistrup <kseis@magnetic-ink.dk> * Written by: Klaus Alexander Seistrup <kseis@magnetic-ink.dk>
* With minor mods by: Landon Curt Noll <http://reality.sgi.com/chongo/> * With minor mods by: Landon Curt Noll <http://www.isthe.com/chongo/>
* *
* See: * See:
* http://www.magnetic-ink.dk/download/qtime.html * http://www.magnetic-ink.dk/download/qtime.html
* *
* for examples of qtime() written on other languages. * for examples of qtime() written on other languages.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: qtime.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: qtime.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/qtime.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/qtime.cal,v $
* *
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: quat.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: quat.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/quat.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/quat.cal,v $
* *
* Under source code control: 1990/02/15 01:50:35 * Under source code control: 1990/02/15 01:50:35
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: randbitrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: randbitrun.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randbitrun.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randbitrun.cal,v $
* *
* Under source code control: 1995/02/13 03:43:11 * Under source code control: 1995/02/13 03:43:11
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: randmprime.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: randmprime.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randmprime.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randmprime.cal,v $
* *
* Under source code control: 1994/03/14 23:11:21 * Under source code control: 1994/03/14 23:11:21
* File existed as early as: 1994 * File existed as early as: 1994
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: randombitrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: randombitrun.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randombitrun.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randombitrun.cal,v $
* *
* Under source code control: 1995/02/13 03:43:11 * Under source code control: 1995/02/13 03:43:11
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: randomrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: randomrun.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randomrun.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randomrun.cal,v $
* *
* Under source code control: 1997/02/19 03:35:59 * Under source code control: 1997/02/19 03:35:59
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: randrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: randrun.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randrun.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randrun.cal,v $
* *
* Under source code control: 1995/02/12 20:00:06 * Under source code control: 1995/02/12 20:00:06
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.3 $
* @(#) $Id: regress.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ * @(#) $Id: regress.cal,v 29.3 2000/06/07 14:02:25 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $
* *
* Under source code control: 1990/02/15 01:50:36 * Under source code control: 1990/02/15 01:50:36
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*
@@ -755,7 +755,7 @@ define test_functions()
vrfy(den(17) == 1, '712: den(17) == 1'); vrfy(den(17) == 1, '712: den(17) == 1');
vrfy(den(3/7) == 7, '713: den(3/7) == 7'); vrfy(den(3/7) == 7, '713: den(3/7) == 7');
vrfy(den(-2/3) == 3, '714: den(-2/3) == 3'); vrfy(den(-2/3) == 3, '714: den(-2/3) == 3');
vrfy(digits(0) == 1, '715: digits(0) == 1'); vrfy(digits(0) == 0, '715: digits(0) == 0');
vrfy(digits(9) == 1, '716: digits(9) == 1'); vrfy(digits(9) == 1, '716: digits(9) == 1');
vrfy(digits(10) == 2, '717: digits(10) == 2'); vrfy(digits(10) == 2, '717: digits(10) == 2');
vrfy(digits(-691) == 3, '718: digits(-691) == 3'); vrfy(digits(-691) == 3, '718: digits(-691) == 3');
@@ -1029,8 +1029,8 @@ define test_functions()
vrfy(digit(a,-1) == 4, '974: digit(a,-1) == 4'); vrfy(digit(a,-1) == 4, '974: digit(a,-1) == 4');
vrfy(digit(a,-2) == 2, '975: digit(a,-2) == 2'); vrfy(digit(a,-2) == 2, '975: digit(a,-2) == 2');
vrfy(digit(a,-3) == 8, '976: digit(a,-3) == 8'); vrfy(digit(a,-3) == 8, '976: digit(a,-3) == 8');
vrfy(digits(0) == 1, '977: digits(0) == 1'); vrfy(digits(0) == 0, '977: digits(0) == 0');
vrfy(digits(0.0123) == 1, '978: digits(0.0123) == 1'); vrfy(digits(0.0123) == 0, '978: digits(0.0123) == 0');
vrfy(digits(3.7) == 1, '979: digits(3.7) == 1'); vrfy(digits(3.7) == 1, '979: digits(3.7) == 1');
vrfy(digits(-27) == 2, '980: digits(-27) == 2'); vrfy(digits(-27) == 2, '980: digits(-27) == 2');
vrfy(digits(-99.7) == 2, '981: digits(-99.7) == 2'); vrfy(digits(-99.7) == 2, '981: digits(-99.7) == 2');
@@ -2987,7 +2987,7 @@ define test_error()
vrfy(root(3,2,0) == error(10029), vrfy(root(3,2,0) == error(10029),
'3644: root(3,2,0) == error(10029)'); '3644: root(3,2,0) == error(10029)');
vrfy(norm("x") == error(10030), '3645: norm("x") == error(10030)'); vrfy(norm("x") == error(10030), '3645: norm("x") == error(10030)');
vrfy(null() << 2 == error(10031),'3646: null() << 2 == error(10031)'); vrfy(list() << 2 == error(10031),'3646: list() << 2 == error(10031)');
vrfy(1.5 << 2 == error(10031), '3647: 1.5 << 2 == error(10031)'); vrfy(1.5 << 2 == error(10031), '3647: 1.5 << 2 == error(10031)');
vrfy(3 << "x" == error(10032), '3648: 3 << "x" == error(10032)'); vrfy(3 << "x" == error(10032), '3648: 3 << "x" == error(10032)');
vrfy(3 << 1.5 == error(10032), '3649: 3 << 1.5 == error(10032)'); vrfy(3 << 1.5 == error(10032), '3649: 3 << 1.5 == error(10032)');
@@ -3085,8 +3085,7 @@ define test_error()
print '3712: e9999 = error(9999)'; print '3712: e9999 = error(9999)';
vrfy(errno() == 9999, '3713: errno() == 9999'); vrfy(errno() == 9999, '3713: errno() == 9999');
vrfy(error() == e9999, '3714: error() == e9999'); vrfy(error() == e9999, '3714: error() == e9999');
vrfy(substr(strerror(), strpos(strerror(),"9999"), 4) == "9999", /* test 3715 removed due to non-portable strerror() output */
'3715: substr(strerror(), strpos(strerror(),"9999"), 4) == "9999"');
x = newerror("Alpha"); x = newerror("Alpha");
print '3716: x = newerror("Alpha")'; print '3716: x = newerror("Alpha")';
n = iserror(x); n = iserror(x);
@@ -3097,16 +3096,14 @@ define test_error()
vrfy(errno(9999) == n, '3721: errno() == n'); vrfy(errno(9999) == n, '3721: errno() == n');
vrfy(errno() == 9999, '3722: errno() == 9999'); vrfy(errno() == 9999, '3722: errno() == 9999');
vrfy(error() == e9999, '3723: error() == e9999'); vrfy(error() == e9999, '3723: error() == e9999');
vrfy(substr(strerror(), strpos(strerror(),"9999"), 4) == "9999", /* test 3724 removed due to non-portable strerror() output */
'3724: substr(strerror(), strpos(strerror(),"9999"), 4) == "9999"');
a = 1/0; a = 1/0;
print '3725: a = 1/0'; print '3725: a = 1/0';
vrfy(strerror() == "Division by zero", vrfy(strerror() == "Division by zero",
'3726: strerror() == "Division by zero"'); '3726: strerror() == "Division by zero"');
n = 8191; n = 8191;
print '3727: n = 8191'; print '3727: n = 8191';
vrfy(substr(strerror(8191),strpos(strerror(n),"8191"), 4) == "8191", /* test 3728 removed due to non-portable strerror() output */
'3728: substr(strerror(n),strpos(strerror(n),"8191"),4) == "8191"');
/* errmax and errcount should be bumped up the 148 errors above */ /* errmax and errcount should be bumped up the 148 errors above */
vrfy(errcount() == ecnt, '3729: errcount() == ecnt'); vrfy(errcount() == ecnt, '3729: errcount() == ecnt');

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: seedrandom.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: seedrandom.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/seedrandom.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/seedrandom.cal,v $
* *
* Under source code control: 1996/01/01 08:21:00 * Under source code control: 1996/01/01 08:21:00
* File existed as early as: 1996 * File existed as early as: 1996
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: solve.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: solve.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/solve.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/solve.cal,v $
* *
* Under source code control: 1990/02/15 01:50:37 * Under source code control: 1990/02/15 01:50:37
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: sumsq.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: sumsq.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/sumsq.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/sumsq.cal,v $
* *
* Under source code control: 1990/02/15 01:50:37 * Under source code control: 1990/02/15 01:50:37
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: surd.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: surd.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/surd.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/surd.cal,v $
* *
* Under source code control: 1990/02/15 01:50:38 * Under source code control: 1990/02/15 01:50:38
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test1700.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test1700.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test1700.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test1700.cal,v $
* *
* Under source code control: 1994/03/14 23:12:51 * Under source code control: 1994/03/14 23:12:51
* File existed as early as: 1994 * File existed as early as: 1994
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test2300.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test2300.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2300.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2300.cal,v $
* *
* Under source code control: 1995/07/09 06:12:13 * Under source code control: 1995/07/09 06:12:13
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test2600.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test2600.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2600.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2600.cal,v $
* *
* Under source code control: 1995/10/13 00:13:14 * Under source code control: 1995/10/13 00:13:14
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test2700.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test2700.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2700.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2700.cal,v $
* *
* Under source code control: 1995/11/01 22:52:25 * Under source code control: 1995/11/01 22:52:25
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test3100.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test3100.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3100.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3100.cal,v $
* *
* Under source code control: 1995/11/28 11:56:57 * Under source code control: 1995/11/28 11:56:57
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test3300.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ * @(#) $Id: test3300.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3300.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3300.cal,v $
* *
* Under source code control: 1995/12/02 04:27:41 * Under source code control: 1995/12/02 04:27:41
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test3400.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test3400.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3400.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3400.cal,v $
* *
* Under source code control: 1995/12/02 05:20:11 * Under source code control: 1995/12/02 05:20:11
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test3500.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test3500.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3500.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3500.cal,v $
* *
* Under source code control: 1995/12/18 22:50:46 * Under source code control: 1995/12/18 22:50:46
* File existed as early as: 1995 * File existed as early as: 1995
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test4000.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test4000.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4000.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4000.cal,v $
* *
* Under source code control: 1996/03/13 02:38:45 * Under source code control: 1996/03/13 02:38:45
* File existed as early as: 1996 * File existed as early as: 1996
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test4100.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test4100.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4100.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4100.cal,v $
* *
* Under source code control: 1996/03/13 03:53:22 * Under source code control: 1996/03/13 03:53:22
* File existed as early as: 1996 * File existed as early as: 1996
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test4600.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test4600.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4600.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4600.cal,v $
* *
* Under source code control: 1996/07/02 20:04:40 * Under source code control: 1996/07/02 20:04:40
* File existed as early as: 1996 * File existed as early as: 1996
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test5100.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test5100.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5100.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5100.cal,v $
* *
* Under source code control: 1996/12/02 23:57:10 * Under source code control: 1996/12/02 23:57:10
* File existed as early as: 1996 * File existed as early as: 1996
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test5200.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test5200.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5200.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5200.cal,v $
* *
* Under source code control: 1997/02/07 02:48:10 * Under source code control: 1997/02/07 02:48:10
* File existed as early as: 1997 * File existed as early as: 1997
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test8400.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test8400.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8400.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8400.cal,v $
* *
* Under source code control: 1999/10/31 01:00:03 * Under source code control: 1999/10/31 01:00:03
* File existed as early as: 1999 * File existed as early as: 1999
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: test8500.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: test8500.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8500.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8500.cal,v $
* *
* Under source code control: 1999/11/12 20:59:59 * Under source code control: 1999/11/12 20:59:59
* File existed as early as: 1999 * File existed as early as: 1999
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: unitfrac.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: unitfrac.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/unitfrac.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/unitfrac.cal,v $
* *
* Under source code control: 1990/02/15 01:50:38 * Under source code control: 1990/02/15 01:50:38
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: varargs.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: varargs.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/varargs.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/varargs.cal,v $
* *
* Under source code control: 1991/05/22 21:56:34 * Under source code control: 1991/05/22 21:56:34
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: xx_print.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ * @(#) $Id: xx_print.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/xx_print.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/xx_print.cal,v $
* *
* Under source code control: 1997/04/17 00:08:50 * Under source code control: 1997/04/17 00:08:50
* File existed as early as: 1997 * File existed as early as: 1997
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

741
calc.c
View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.2 $ * @(#) $Revision: 29.4 $
* @(#) $Id: calc.c,v 29.2 1999/12/17 09:21:45 chongo Exp $ * @(#) $Id: calc.c,v 29.4 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.c,v $
* *
* Under source code control: 1990/02/15 01:48:11 * Under source code control: 1990/02/15 01:48:11
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -70,8 +70,8 @@
* static definitions and functions * static definitions and functions
*/ */
static void intint(int arg); /* interrupt routine */ static void intint(int arg); /* interrupt routine */
static int script_args(int argc,char ***argv,char **shellfile,char **program); static int nextcp(char **cpp, int *ip, int argc, char **argv, BOOL haveendstr);
static void set_run_state(run state);
/* /*
* Top level calculator routine. * Top level calculator routine.
@@ -81,26 +81,57 @@ main(int argc, char **argv)
{ {
int want_defhelp = 0; /* 1=> we only want the default help */ int want_defhelp = 0; /* 1=> we only want the default help */
int cmdlen; /* length of the command string */ int cmdlen; /* length of the command string */
char *shellfile = NULL; /* != NULL ==> name of calc shell script */ int newcmdlen;
extern char *optarg; /* option argument */
extern int optind; /* option index */
int c; /* option */ int c; /* option */
char *p; int index;
long i; int maxindex;
char *cp;
char *endcp;
char *bp;
BOOL done = FALSE;
BOOL havearg;
BOOL haveendstr;
int len;
/* /*
* parse args * parse args
*/ */
program = argv[0]; program = argv[0];
/* catch the case of a leading -S option */
if (argc > 2 && strncmp(argv[1], "-S", 2) == 0) { cmdbuf[0] = '\0';
/* convert the calc shell options into command line options */ cmdlen = 0;
argc = script_args(argc, &argv, &shellfile, &program);
/* -S implies -s */
s_flag = TRUE;
}
/* process command line options */ /* process command line options */
while ((c = getopt(argc, argv, "Cehim:npquvcdD:s")) != -1) {
index = 1;
cp = endcp = NULL;
maxindex = argc;
havecommands = FALSE;
while (index < maxindex && !done) {
cp = argv[index];
if (*cp == '\0') {
index++;
continue;
}
for (;;) {
havearg = FALSE;
if (*cp != '-') {
done = TRUE;
break;
}
++cp;
if (*cp == '-') {
cp++;
while (*cp == ' ')
++cp;
done = TRUE;
break;
}
for (;;) {
c = *cp;
if (c == '\0' || c == ' ')
break;
switch (c) { switch (c) {
case 'C': case 'C':
#if defined(CUSTOM) #if defined(CUSTOM)
@@ -108,12 +139,14 @@ main(int argc, char **argv)
break; break;
#else /* CUSTOM */ #else /* CUSTOM */
/* /*
* we are too early in processing to call * we are too early in processing to
* libcalc_call_me_last() - nothing to cleanup * call libcalc_call_me_last() -
* nothing to cleanup
*/ */
fprintf(stderr, fprintf(stderr,
"%s: calc was built with custom functions " "%s: calc was built with custom"
"disabled, -C usage is disallowed\n", program); " functions disabled, -C usage is"
" disallowed\n", program);
exit(1); exit(1);
#endif /* CUSTOM */ #endif /* CUSTOM */
case 'e': case 'e':
@@ -126,19 +159,41 @@ main(int argc, char **argv)
i_flag = TRUE; i_flag = TRUE;
break; break;
case 'm': case 'm':
if (optarg[1] != '\0' || *optarg<'0' || *optarg>'7') { cp++;
while (*cp == ' ' || *cp == '\t')
cp++;
if (*cp == '\0') {
index++;
if (index >= argc) {
fprintf(stderr,
"-m expects"
" argument");
exit (1);
}
cp = argv[index];
}
if (*cp < '0' || *cp > '7') {
/* /*
* we are too early in processing to * we are too early in
* call libcalc_call_me_last() * processing to call
* libcalc_call_me_last()
* nothing to cleanup * nothing to cleanup
*/ */
fprintf(stderr, fprintf(stderr,
"%s: unknown -m arg\n", program); "%s: unknown -m arg\n",
program);
exit(1); exit(1);
} }
allow_read = (((*optarg-'0') & 04) > 0); allow_read = (((*cp-'0') & 04) > 0);
allow_write = (((*optarg-'0') & 02) > 0); allow_write = (((*cp-'0') & 02) > 0);
allow_exec = (((*optarg-'0') & 01) > 0); allow_exec = (((*cp-'0') & 01) > 0);
cp++;
if (*cp != ' ' && *cp != '\0') {
fprintf(stderr, "??? m-arg");
exit(1);
}
havearg = TRUE;
break; break;
case 'n': case 'n':
new_std = TRUE; new_std = TRUE;
@@ -160,107 +215,242 @@ main(int argc, char **argv)
break; break;
case 'v': case 'v':
/* /*
* we are too early in processing to call * we are too early in processing to
* libcalc_call_me_last() - nothing to cleanup * call libcalc_call_me_last() -
* nothing to cleanup
*/ */
printf("%s (version %s)\n", CALC_TITLE, version()); printf("%s (version %s)\n",
CALC_TITLE, version());
exit(0); exit(0);
case 'D': case 'D':
/* /*
* parse the -D optarg * parse the -D arg
* *
* Could be calc_debug * Could be:
* or calc_debug:resource_debug *
* or calc_debug:resource_debug:user_debug * calc_debug
* calc_debug:resource_debug
* calc_debug:resource_debug:user_debug
*/ */
calc_debug = optarg; if (nextcp(&cp, &index, argc, argv,
p = strchr(optarg, ':'); FALSE)) {
if (p != NULL) { fprintf(stderr,
*p = '\0'; "-D expects argument\n");
resource_debug = p+1; exit (1);
p = strchr(resource_debug, ':');
if (p != NULL) {
*p = '\0';
user_debug = p+1;
} }
havearg = TRUE;
if (*cp != ':') {
if (*cp < '0' || *cp > '9') {
fprintf(stderr,
"-D expects"
" integer\n");
exit (1);
}
calc_debug = cp;
(void) strtol(cp, &endcp, 10);
cp = endcp;
if (*cp != '\0' &&
*cp != ' ' && *cp != ':') {
fprintf(stderr,
"Bad syntax im -D"
" arg\n");
exit (1);
}
if (*cp != ':') {
if (nextcp(&cp, &index,
argc, argv,
FALSE)
|| *cp != ':')
break;
}
}
if (nextcp(&cp, &index, argc, argv,
FALSE)) {
fprintf(stderr,
"-D : expects"
" argument\n");
exit (1);
}
if (*cp != ':') {
if (*cp < '0' || *cp > '9') {
fprintf(stderr,
"-D : expects"
" integer\n");
exit (1);
}
resource_debug = cp;
(void) strtol(cp, &endcp, 10);
cp = endcp;
if (*cp != '\0' &&
*cp != ' ' && *cp != ':') {
fprintf(stderr,
"Bad syntax im -D"
" : arg\n");
exit (1);
}
if (*cp != ':') {
if (nextcp(&cp, &index,
argc, argv,
FALSE)
|| *cp != ':') {
break;
}
}
}
if (nextcp(&cp, &index, argc, argv,
FALSE)) {
fprintf(stderr, "-D : : expects"
" argument\n");
exit (1);
}
if (*cp < '0' || *cp > '9') {
fprintf(stderr, "-D :: expects"
" integer\n");
exit (1);
}
user_debug = cp;
(void) strtol(cp, &endcp, 10);
cp = endcp;
if (*cp != '\0' && *cp != ' ') {
fprintf(stderr, "Bad syntax in"
" -D : : arg\n");
exit (1);
} }
break; break;
case 'f':
haveendstr = (cp[1] == '\0');
if (nextcp(&cp, &index, argc, argv,
haveendstr)) {
fprintf(stderr, "-f expects"
" filename\n");
exit (1);
}
if (*cp == ';') {
fprintf(stderr,
"-f expects"
" filename\n");
exit (1);
}
havearg = TRUE;
if (cmdlen > 0)
cmdbuf[cmdlen++] = ' ';
strcpy(cmdbuf + cmdlen, "read ");
cmdlen += 5;
if (strncmp(cp, "-once", 5) == 0 &&
(cp[5] == '\0' || cp[5] == ' ')) {
cp += 5;
haveendstr = (*cp == '\0');
strcpy(cmdbuf+cmdlen, "-once ");
cmdlen += 6;
if (nextcp(&cp, &index, argc,
argv, haveendstr)) {
fprintf(stderr, "-f -once"
" expects"
" filename\n");
exit (1);
}
}
bp = cmdbuf + cmdlen;
if (haveendstr) {
len = strlen(cp);
if (len == 0) {
fprintf(stderr,
"Null"
" filename!");
exit (1);
}
if (cmdlen + len + 2 > MAXCMD) {
fprintf(stderr,
"Commands too"
" long");
exit (1);
}
/* XXX What if *cp = '\''? */
*bp++ = '\'';
strcpy(bp, cp);
bp += len;
*bp++ = '\'';
cp += len;
cmdlen += len + 2;
} else {
do {
if (cmdlen > MAXCMD) {
fprintf(stderr,
"Commands"
" too long");
exit (1);
}
*bp++ = *cp++;
cmdlen++;
} while (*cp != '\0' &&
*cp != ';' &&
*cp != ' ');
}
if (*cp == ';')
cp++;
*bp++ = ';';
cmdlen++;
break;
case 's': case 's':
s_flag = TRUE; s_flag = TRUE;
maxindex = index + 1;
break; break;
case 'S':
/*FALLTHRU*/
default: default:
/* /*
* we are too early in processing to call * we are too early in processing to
* libcalc_call_me_last() - nothing to cleanup * call libcalc_call_me_last() -
* nothing to cleanup
*/ */
fprintf(stderr, "Illegal option -%c\n",
c);
fprintf(stderr, fprintf(stderr,
"usage: %s [-c] [-C] [-d] [-e] [-h] [-i] [-m mode]\n" "usage: %s [-a] [-c] [-C] [-d] [-e] [-h] [-i] [-m mode]\n"
"\t[-D calc_debug[:resource_debug[:user_debug]]]\n" "\t[-D calc_debug[:resource_debug[:user_debug]]]\n"
"\t[-n] [-p] [-q] [-s] [-u] [-v] " "\t[-n] [-p] [-q] [-u] [-v] "
"[[--] calc_cmd ...]\n", "[--] [calc_cmd ...]\n",
program); program);
exit(1); exit(1);
} }
if (havearg)
break;
cp++;
}
while (*cp == ' ')
cp++;
if (*cp == '\0') {
index++;
break;
}
}
} }
/* while (index < maxindex) {
* If -S was given via a calc shell script, imply -p and -d if (cmdlen > 0)
* unless -i was also given.
*/
if (shellfile != NULL && !i_flag) {
p_flag = TRUE;
d_flag = TRUE;
}
/*
* look at the length of any trailing command args
*
* We make room for the trailing '\0\n' as well as an extra guard byte.
*
* However, if -S is in effect, we will pretend that we have no
* command args and allow the argv() builtin access to the strings.
*/
cmdbuf[0] = '\0';
if (s_flag) {
havecommands = FALSE;
argc_value = argc - optind;
argv_value = argv + optind;
} else {
havecommands = (optind < argc);
for (cmdlen=0, i=optind; i < argc; ++i) {
/* argument + space separator */
cmdlen += strlen(argv[i]) + 1;
}
if (i > MAXCMD) {
/*
* we are too early in processing to call
* libcalc_call_me_last() - nothing to cleanup
*/
fprintf(stderr,
"%s: command in arg list is too long\n",
program);
exit(1);
}
/*
* Form a command the remaining args separated by spaces.
*/
if (optind < argc) {
strcpy(cmdbuf, argv[optind]);
cmdlen = strlen(argv[optind]);
for (i=optind+1; i < argc; ++i) {
cmdbuf[cmdlen++] = ' '; cmdbuf[cmdlen++] = ' ';
strcpy(cmdbuf+cmdlen, argv[i]); newcmdlen = cmdlen + strlen(cp);
cmdlen += strlen(argv[i]); if (newcmdlen > MAXCMD) {
fprintf(stderr,
"%s: commands too long\n",
program);
exit(1);
} }
strcpy(cmdbuf + cmdlen, cp);
cmdlen = newcmdlen;
index++;
if (index < maxindex)
cp = argv[index];
}
havecommands = (cmdlen > 0);
if (havecommands) {
cmdbuf[cmdlen++] = '\n'; cmdbuf[cmdlen++] = '\n';
cmdbuf[cmdlen] = '\0'; cmdbuf[cmdlen] = '\0';
} }
argc_value = 0;
argv_value = argv+argc; argc_value = argc - maxindex;
} argv_value = argv + maxindex;
/* /*
* unbuffered mode * unbuffered mode
@@ -270,6 +460,7 @@ main(int argc, char **argv)
setbuf(stdout, NULL); setbuf(stdout, NULL);
} }
/* /*
* initialize * initialize
*/ */
@@ -333,18 +524,10 @@ main(int argc, char **argv)
*/ */
if (run_state == RUN_BEGIN) { if (run_state == RUN_BEGIN) {
if (!q_flag && allow_read) { if (!q_flag && allow_read) {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_RCFILES);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_RCFILES));
run_state = RUN_RCFILES;
runrcfiles(); runrcfiles();
} }
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_CMD_ARGS);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_CMD_ARGS));
run_state = RUN_PRE_CMD_ARGS;
} }
while (run_state == RUN_RCFILES) { while (run_state == RUN_RCFILES) {
@@ -354,55 +537,27 @@ main(int argc, char **argv)
if (inputlevel() == 0) { if (inputlevel() == 0) {
closeinput(); closeinput();
runrcfiles(); runrcfiles();
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_CMD_ARGS);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_CMD_ARGS));
run_state = RUN_PRE_CMD_ARGS;
} else { } else {
closeinput(); closeinput();
} }
} else { } else {
if ((havecommands && !i_flag) || !stdin_tty) { if ((havecommands && !i_flag) || !stdin_tty) {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_EXIT_WITH_ERROR);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_EXIT_WITH_ERROR));
run_state = RUN_EXIT_WITH_ERROR;
} else { } else {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_CMD_ARGS);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_CMD_ARGS));
run_state = RUN_PRE_CMD_ARGS;
} }
} }
} }
if (run_state == RUN_PRE_CMD_ARGS) { if (run_state == RUN_PRE_CMD_ARGS) {
if (havecommands) { if (havecommands) {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_CMD_ARGS);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_CMD_ARGS));
run_state = RUN_CMD_ARGS;
(void) openstring(cmdbuf, (long) strlen(cmdbuf)); (void) openstring(cmdbuf, (long) strlen(cmdbuf));
getcommands(FALSE); getcommands(FALSE);
closeinput(); closeinput();
} else if (shellfile != NULL) {
/* XXX - shellfile stuff needs it own run_state name */
if (conf->calc_debug & CALCDBG_RUNSTATE)
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_CMD_ARGS));
run_state = RUN_CMD_ARGS;
getshellfile(shellfile);
} }
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_TOP_LEVEL);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_TOP_LEVEL));
run_state = RUN_PRE_TOP_LEVEL;
} }
while (run_state == RUN_CMD_ARGS) { while (run_state == RUN_CMD_ARGS) {
@@ -410,38 +565,22 @@ main(int argc, char **argv)
if ((c_flag && !stoponerror) || stoponerror < 0) { if ((c_flag && !stoponerror) || stoponerror < 0) {
getcommands(FALSE); getcommands(FALSE);
if (inputlevel() == 0) if (inputlevel() == 0)
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_TOP_LEVEL);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_TOP_LEVEL));
run_state = RUN_PRE_TOP_LEVEL;
closeinput(); closeinput();
} else { } else {
closeinput(); closeinput();
if (!stdin_tty || !i_flag || p_flag) { if (!stdin_tty || !i_flag || p_flag) {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_EXIT_WITH_ERROR);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_EXIT_WITH_ERROR));
run_state = RUN_EXIT_WITH_ERROR;
} else { } else {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_PRE_TOP_LEVEL);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_PRE_TOP_LEVEL));
run_state = RUN_PRE_TOP_LEVEL;
} }
} }
} }
if (run_state == RUN_PRE_TOP_LEVEL) { if (run_state == RUN_PRE_TOP_LEVEL) {
if (stdin_tty && if (stdin_tty &&
(((havecommands || shellfile) && !i_flag) || p_flag)) { (((havecommands) && !i_flag) || p_flag)) {
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_EXIT);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_EXIT));
run_state = RUN_EXIT;
} else { } else {
if (stdin_tty) { if (stdin_tty) {
reinitialize(); reinitialize();
@@ -449,40 +588,71 @@ main(int argc, char **argv)
resetinput(); resetinput();
openterminal(); openterminal();
} }
if (conf->calc_debug & CALCDBG_RUNSTATE) set_run_state(RUN_TOP_LEVEL);
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(RUN_TOP_LEVEL));
run_state = RUN_TOP_LEVEL;
getcommands(TRUE); getcommands(TRUE);
} }
if (p_flag || (!i_flag && havecommands))
set_run_state(RUN_EXIT);
} }
while (run_state == RUN_TOP_LEVEL) { while (run_state == RUN_TOP_LEVEL) {
if (conf->calc_debug & CALCDBG_RUNSTATE)
printf("main: run_state = TOP_LEVEL\n");
if ((c_flag && !stoponerror) || stoponerror < 0) { if ((c_flag && !stoponerror) || stoponerror < 0) {
getcommands(TRUE); getcommands(TRUE);
if (!inputisterminal()) if (!inputisterminal()) {
closeinput(); closeinput();
continue;
}
if (!p_flag && i_flag && !stdin_tty) {
closeinput();
if(!freopen("/dev/tty", "r", stdin)) {
fprintf(stderr,
"Unable to associate stdin"
" with /dev/tty");
set_run_state(RUN_EXIT_WITH_ERROR);
break;
}
stdin_tty = TRUE;
if (conf->calc_debug & CALCDBG_TTY)
printf("main: stdin_tty is %d\n",
stdin_tty);
reinitialize();
}
} else { } else {
if (stdin_tty) { if (stdin_tty) {
reinitialize(); reinitialize();
getcommands(TRUE); getcommands(TRUE);
} else if (inputisterminal() &&
!p_flag && (!havecommands||i_flag)) {
closeinput();
if(!freopen("/dev/tty", "r", stdin)) {
fprintf(stderr,
"Unable to associate stdin"
" with /dev/tty");
set_run_state(RUN_EXIT_WITH_ERROR);
break;
}
stdin_tty = TRUE;
if (conf->calc_debug & CALCDBG_TTY)
printf("main: stdin_tty is %d\n",
stdin_tty);
reinitialize();
} else { } else {
set_run_state(RUN_EXIT_WITH_ERROR);
}
}
}
if (conf->calc_debug & CALCDBG_RUNSTATE) if (conf->calc_debug & CALCDBG_RUNSTATE)
printf("main: run_state from %s to %s\n", printf("main: run_state = %s\n", run_state_name(run_state));
run_state_name(run_state),
run_state_name(RUN_EXIT_WITH_ERROR));
run_state = RUN_EXIT_WITH_ERROR;
}
}
}
/* /*
* all done * all done
*/ */
libcalc_call_me_last(); libcalc_call_me_last();
return (run_state == RUN_EXIT_WITH_ERROR || return (run_state == RUN_EXIT_WITH_ERROR ||
run_state == RUN_UNKNOWN) ? 1 : 0; run_state == RUN_ZERO) ? 1 : 0;
} }
@@ -540,183 +710,52 @@ math_error(char *fmt, ...)
} }
} }
/*
* script_args - concert shell script options into command line form
*
* When a calc shell script is executed, the args are presented to calc
* in a different form. Consider the a calc shell script called /tmp/calcit:
*
* #!/usr/local/bin/calc -S -q -p
* a=eval(prompt("Enter a: "));
* b=eval(prompt("Enter b: "));
* print a+b;
*
* When it is executed as:
*
* /tmp/calcit -D 31
*
* then calc will receive the following as args to main():
*
* argc: 5
* argv[0]: "/usr/local/bin/calc"
* argv[1]: "-S -q -p -e"
* argv[2]: "/tmp/calcit"
* argv[3]: "-D"
* argv[4]: "31"
* argv[5]: NULL
*
* NOTE: The user MUST put -S as the first characters on the calc shell
* script #! line, right after the calc binary path.
*
* NOTE: The arg supplied on the #! calc shell script line are returned
* as a single string. All tabs are converted into spaces.
*
* We must remember the calc script filename, break apart the #! args
* and remove the -S argument. In the above case we would return:
*
* argc: 6
* argv[0]: "/usr/local/bin/calc"
* argv[1]: "-q"
* argv[2]: "-p"
* argv[3]: "-e"
* argv[4]: "-D"
* argv[5]: "31"
* argv[6]: NULL
*
* shellfile: "/tmp/calcit"
* s_flag: TRUE
*/
static int static int
script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) nextcp(char **cpp, int *ip, int argc, char **argv, BOOL haveendstr)
{ {
char **argv; /* new argv to return */ char *cp;
char *shellfile; /* shell file pathname to return */ int index;
int delta; /* the change needed in argc */
int i;
int j;
char *p;
char *q;
/* cp = *cpp;
* must have at least 3 args and the 2nd must start with -S index = *ip;
*/
argv = *argv_p;
if (argc < 3 || strncmp(argv[1], "-S", 2) != 0) {
/*
* we are too early in processing to call
* libcalc_call_me_last() - nothing to cleanup
*/
fprintf(stderr,
"%s: FATAL: bad args passed to script_args\n", program);
exit(1);
}
shellfile = argv[2];
/*
* count the additional args beyond the -S
*/
if (argv[1][2] == ' ') {
/* if (haveendstr) {
* process args beyond -S on the #!/usr/local/bin line index++;
*/ *ip = index;
p = argv[1]+3 + strspn(argv[1]+3," "); if (index >= argc)
q = p; return 1;
if (q == '\0') { *cpp = argv[index];
return 0;
/* only trailing spaces after -S, ignore them */
for (i = 3; i <= argc; ++i) {
argv[i-2] = argv[i];
}
argc -= 2;
} else {
/* count the space separated strings that follow -S */
for (delta = -1; p != NULL && *p;
p = strchr(p+1,' '), ++delta) {
/* skip multiple spaces in a row */
p += strspn(p, " ");
} }
/* allocate the new set of argv pointers */ if (*cp != '\0')
argv = (char **)malloc(sizeof(char *) * argc+delta); cp++;
if (argv == NULL) { for (;;) {
/* if (*cp == '\0') {
* we are too early in processing to call index++;
* libcalc_call_me_last() - nothing to cleanup *ip = index;
*/ if (index >= argc)
fprintf(stderr, return 1;
"%s: failed to malloc %d pointers\n", cp = argv[index];
shellfile, argc+delta);
exit(1);
} }
while (*cp == ' ')
/* we have the same 0th arg */ cp++;
argv[0] = (*argv_p)[0]; if (*cp != '\0')
break;
/* args may be read-only, so duplicate 1st arg */
p = strdup(q);
if (p == NULL) {
/*
* we are too early in processing to call
* libcalc_call_me_last() - nothing to cleanup
*/
fprintf(stderr,
"%s: failed to duplicate 1st arg\n",
shellfile);
exit(1);
} }
*cpp = cp;
/* tokenize the 1st arg */ return 0;
for (p=strtok(q," "), i=1; p != NULL;
p=strtok(NULL," "), ++i) {
argv[i] = p;
}
/* save the 3rd and later args */
for (j=3; (*argv_p)[j] != NULL; ++j, ++i) {
argv[i] = (*argv_p)[j];
}
argv[i] = NULL;
/* set argc */
argc = i;
}
/*
* catch the case of #!/usr/local/bin -Stuff_not_extra_args
*/
} else if (argv[1][2] != '\0') {
/*
* we are too early in processing to call
* libcalc_call_me_last() - nothing to cleanup
*/
fprintf(stderr,
"%s: malformed #! line, -S must be "
"followed by space or newline\n",
shellfile);
exit(1);
/*
* Only -S was given in the #!/usr/local/bin line, so we just
* toss the 2nd and 3rd args
*/
} else {
for (i = 3; i <= argc; ++i) {
argv[i-2] = argv[i];
}
argc -= 2;
}
/*
* return and set the argc, argv, shellfile_p and s_flag values
*/
*argv_p = argv;
*shellfile_p = shellfile;
*program_p = shellfile;
s_flag = TRUE;
return argc;
} }
static void
set_run_state(run state)
{
if (conf->calc_debug & CALCDBG_RUNSTATE)
printf("main: run_state from %s to %s\n",
run_state_name(run_state),
run_state_name(state));
run_state = state;
}

26
calc.h
View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.2 $ * @(#) $Revision: 29.3 $
* @(#) $Id: calc.h,v 29.2 1999/12/14 19:37:46 chongo Exp $ * @(#) $Id: calc.h,v 29.3 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
* *
* Under source code control: 1990/02/15 01:48:31 * Under source code control: 1990/02/15 01:48:31
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -60,7 +60,6 @@
#define MAXERROR 512 /* maximum length of error message string */ #define MAXERROR 512 /* maximum length of error message string */
#define SYMBOLSIZE 256 /* maximum symbol name size */ #define SYMBOLSIZE 256 /* maximum symbol name size */
#define MAXINDICES 20 /* maximum number of indices for objects */
#define MAXLABELS 100 /* maximum number of user labels in function */ #define MAXLABELS 100 /* maximum number of user labels in function */
#define MAXSTRING 1024 /* maximum size of string constant */ #define MAXSTRING 1024 /* maximum size of string constant */
#define MAXSTACK 1000 /* maximum depth of evaluation stack */ #define MAXSTACK 1000 /* maximum depth of evaluation stack */
@@ -167,7 +166,6 @@ extern BOOL calc_tty(int fd);
extern BOOL orig_tty(int fd); extern BOOL orig_tty(int fd);
extern void showerrors(void); extern void showerrors(void);
extern char *calc_strdup(CONST char *); extern char *calc_strdup(CONST char *);
extern void getshellfile(char *shellfile);
/* /*
* Initialization * Initialization
@@ -229,15 +227,15 @@ extern int allow_exec; /* FALSE => may not execute any commands */
* calc startup and run state * calc startup and run state
*/ */
typedef enum { typedef enum {
RUN_UNKNOWN = -1, /* unknown or unset start state */ RUN_ZERO, /* unknown or unset start state */
RUN_BEGIN = 0, /* calc execution starts */ RUN_BEGIN, /* calc execution starts */
RUN_RCFILES = 1, /* rc files being evaluated */ RUN_RCFILES, /* rc files being evaluated */
RUN_PRE_CMD_ARGS = 2, /* prepare to evaluate cmd args */ RUN_PRE_CMD_ARGS, /* prepare to evaluate cmd args */
RUN_CMD_ARGS = 3, /* cmd args being evaluated */ RUN_CMD_ARGS, /* cmd args being evaluated */
RUN_PRE_TOP_LEVEL = 4, /* prepare to start top level activity */ RUN_PRE_TOP_LEVEL, /* prepare to start top level activity */
RUN_TOP_LEVEL = 5, /* running at top level */ RUN_TOP_LEVEL, /* running at top level */
RUN_EXIT = 6, /* normal exit from calc */ RUN_EXIT, /* normal exit from calc */
RUN_EXIT_WITH_ERROR = 7 /* exit with error */ RUN_EXIT_WITH_ERROR /* exit with error */
} run; } run;
extern run run_state; extern run run_state;
extern char *run_state_name(run state); extern char *run_state_name(run state);

View File

@@ -15,15 +15,15 @@
.\" received a copy with calc; if not, write to Free Software Foundation, Inc. .\" received a copy with calc; if not, write to Free Software Foundation, Inc.
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. .\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
.\" .\"
.\" @(#) $Revision: 29.4 $ .\" @(#) $Revision: 29.5 $
.\" @(#) $Id: calc.man,v 29.4 1999/12/17 10:06:31 chongo Exp $ .\" @(#) $Id: calc.man,v 29.5 2000/06/07 14:02:13 chongo Exp $
.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $ .\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $
.\" .\"
.\" Under source code control: 1991/07/23 05:48:26 .\" Under source code control: 1991/07/23 05:48:26
.\" File existed as early as: 1991 .\" File existed as early as: 1991
.\" .\"
.\" chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ .\" chongo <was here> /\oo/\ http://www.isthe.com/chongo/
.\" Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ .\" Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
.\" .\"
.\" calculator by David I. Bell .\" calculator by David I. Bell
.\" man page by Landon Noll .\" man page by Landon Noll
@@ -1007,9 +1007,7 @@ in future distributions to:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
calc-tester at postofc dot corp dot sgi dot com calc-contrib at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]]
.fi .fi
.in -0.5i .in -0.5i
.sp .sp
@@ -1017,9 +1015,10 @@ Bug reports are sent to:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
calc-bugs at postofc dot corp dot sgi dot com calc-bugs at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
.fi .fi
.in -0.5i .in -0.5i
.sp .sp
@@ -1045,7 +1044,7 @@ Landon Noll maintains the the
web site is located at: web site is located at:
.sp .sp
.in +0.5i .in +0.5i
http://reality.sgi.com/chongo/tech/comp/calc/ http://www.isthe.com/chongo/tech/comp/calc/
.in -0.5i .in -0.5i
.sp .sp
One may join the One may join the
@@ -1054,9 +1053,10 @@ testing group by sending a request to:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
calc-tester-request at postofc dot corp dot sgi dot com calc-tester-request at asthe dot com
[[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] [[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
.fi .fi
.in -0.5i .in -0.5i
.sp .sp

View File

@@ -17,14 +17,14 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: calcerr.tbl,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: calcerr.tbl,v 29.2 2000/06/07 14:02:13 chongo Exp chongo $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr.tbl,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr.tbl,v $
# #
# Under source code control: 1996/05/23 17:38:44 # Under source code control: 1996/05/23 17:38:44
# File existed as early as: 1996 # File existed as early as: 1996
# #
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# This file is used to build calcerr.h include file. # This file is used to build calcerr.h include file.
# #
@@ -375,3 +375,21 @@ E_GD3 Infinite or too-large result for gd
E_AGD3 Infinite or too-large result for agd E_AGD3 Infinite or too-large result for agd
E_POWER4 Too-large value for power E_POWER4 Too-large value for power
E_ROOT4 Too-large value for root E_ROOT4 Too-large value for root
E_DGT1 Non-real first arg for digit
E_DGT2 Non-integral second arg for digit
E_DGT3 Bad third arg for digit
E_PLCS1 Bad first argument for places
E_PLCS2 Bad second argument for places
E_DGTS1 Bad first argument for digits
E_DGTS2 Bad second argument for digits
E_ILOG Bad first argument for ilog
E_ILOGB Bad second argument for ilog
E_ILOG10 Bad argument for ilog10
E_ILOG2 Bad argument for ilog2
E_COMB1 Non-integer second arg for comb
E_COMB2 Too-large second arg for comb
E_CTLN Bad argument for catalan
E_BERN Bad argument for bern
E_EULER Bad argument for euler
E_SLEEP Bad argument for sleep
E_TTY calc_tty failure

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: calcerr_c.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: calcerr_c.awk,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.awk,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.awk,v $
# #
# Under source code control: 1996/05/24 03:15:35 # Under source code control: 1996/05/24 03:15:35
# File existed as early as: 1996 # File existed as early as: 1996
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
BEGIN { BEGIN {
printf("#include <stdio.h>\n"); printf("#include <stdio.h>\n");

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: calcerr_c.sed,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: calcerr_c.sed,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.sed,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.sed,v $
# #
# Under source code control: 1996/05/24 03:15:35 # Under source code control: 1996/05/24 03:15:35
# File existed as early as: 1996 # File existed as early as: 1996
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
s/#.*// s/#.*//
s/[ ][ ]*$// s/[ ][ ]*$//

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: calcerr_h.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: calcerr_h.awk,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.awk,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.awk,v $
# #
# Under source code control: 1996/05/23 17:38:44 # Under source code control: 1996/05/23 17:38:44
# File existed as early as: 1996 # File existed as early as: 1996
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
BEGIN { BEGIN {
ebase = 10000; ebase = 10000;

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: calcerr_h.sed,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: calcerr_h.sed,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.sed,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.sed,v $
# #
# Under source code control: 1996/05/23 17:38:44 # Under source code control: 1996/05/23 17:38:44
# File existed as early as: 1996 # File existed as early as: 1996
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
s/#.*// s/#.*//
s/[ ][ ]*$// s/[ ][ ]*$//

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: check.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: check.awk,v 29.2 2000/06/07 14:02:13 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $
# #
# Under source code control: 1996/05/25 22:07:58 # Under source code control: 1996/05/25 22:07:58
# File existed as early as: 1996 # File existed as early as: 1996
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
# This awk script will print 3 lines before and after any non-blank line that # This awk script will print 3 lines before and after any non-blank line that
# does not begin with a number. This allows the 'make debug' rule to remove # does not begin with a number. This allows the 'make debug' rule to remove

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: cmath.h,v 29.1 1999/12/14 09:15:35 chongo Exp $ * @(#) $Id: cmath.h,v 29.2 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $
* *
* Under source code control: 1993/07/30 19:42:45 * Under source code control: 1993/07/30 19:42:45
* File existed as early as: 1993 * File existed as early as: 1993
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -83,6 +83,7 @@ extern BOOL ccmp(COMPLEX *c1, COMPLEX *c2);
* More complicated functions. * More complicated functions.
*/ */
extern COMPLEX *cpowi(COMPLEX *c, NUMBER *q); extern COMPLEX *cpowi(COMPLEX *c, NUMBER *q);
extern NUMBER *cilog(COMPLEX *c, ZVALUE base);
/* /*

266
codegen.c
View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: codegen.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ * @(#) $Id: codegen.c,v 29.2 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $
* *
* Under source code control: 1990/02/15 01:48:13 * Under source code control: 1990/02/15 01:48:13
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -49,7 +49,7 @@ static BOOL rdonce; /* TRUE => do not reread this file */
FUNC *curfunc; FUNC *curfunc;
static BOOL getfilename(char *name, BOOL msg_ok, BOOL *once); static int getfilename(char *name, BOOL *once);
static BOOL getid(char *buf); static BOOL getid(char *buf);
static void getshowstatement(void); static void getshowstatement(void);
static void getfunction(void); static void getfunction(void);
@@ -71,7 +71,7 @@ static void getsimplebody(void);
static void getcondition(void); static void getcondition(void);
static void getmatargs(void); static void getmatargs(void);
static void getelement(void); static void getelement(void);
static void usesymbol(char *name, BOOL autodef); static void usesymbol(char *name, int autodef);
static void definesymbol(char *name, int symtype); static void definesymbol(char *name, int symtype);
static void getcallargs(char *name); static void getcallargs(char *name);
static void do_changedir(void); static void do_changedir(void);
@@ -90,9 +90,16 @@ static int getshiftexpr(void);
static int getreference(void); static int getreference(void);
static int getincdecexpr(void); static int getincdecexpr(void);
static int getterm(void); static int getterm(void);
static int getidexpr(BOOL okmat, BOOL autodef); static int getidexpr(BOOL okmat, int autodef);
static long getinitlist(void); static long getinitlist(void);
#define INDICALLOC 8
static int quickindices[INDICALLOC];
static int * newindices;
static int * indices;
static int maxindices;
/* /*
* Read all the commands from an input file. * Read all the commands from an input file.
@@ -133,49 +140,62 @@ getcommands(BOOL toplevel)
return; return;
case T_HELP: case T_HELP:
if (!getfilename(name, FALSE, NULL)) { for (;;) {
switch(getfilename(name, NULL)) {
case 1:
strcpy(name, DEFAULTCALCHELP); strcpy(name, DEFAULTCALCHELP);
} case 0:
givehelp(name); givehelp(name);
continue;
default:
break;
}
break;
}
break; break;
case T_READ: case T_READ:
if (!getfilename(name, TRUE, &rdonce))
break;
if (!allow_read) { if (!allow_read) {
scanerror(T_NULL, scanerror(T_NULL,
"read command disallowed by -m mode\n"); "read command disallowed by -m mode\n");
break; break;
} }
switch (opensearchfile(name,calcpath,CALCEXT,rdonce)) { for (;;) {
if (getfilename(name, &rdonce))
switch (opensearchfile(name,calcpath,
CALCEXT,rdonce)) {
case 0: case 0:
getcommands(FALSE); getcommands(FALSE);
closeinput(); closeinput();
break; continue;
case 1: case 1:
/* previously read and -once was given */ /* prev read and -once was given */
break; continue;
case -2: case -2:
scanerror(T_NULL, scanerror(T_NULL,
"Maximum input depth reached"); "Maximum input depth reached");
break; break;
default: default:
scanerror(T_NULL, "Cannot open \"%s\"\n", name); scanerror(T_NULL,
"Cannot open \"%s\"", name);
continue;
}
break; break;
} }
break; break;
case T_WRITE: case T_WRITE:
if (!getfilename(name, TRUE, NULL))
break;
if (!allow_write) { if (!allow_write) {
scanerror(T_NULL, scanerror(T_NULL,
"write command disallowed by -m mode\n"); "write command disallowed by -m mode\n");
break; break;
} }
if (writeglobals(name)) if (getfilename(name, NULL))
break;
if (writeglobals(name)) {
scanerror(T_NULL, scanerror(T_NULL,
"Error writing \"%s\"\n", name); "Error writing \"%s\"\n", name);
}
break; break;
case T_CD: case T_CD:
@@ -529,7 +549,7 @@ getonevariable(int symtype)
res = getonevariable(symtype); res = getonevariable(symtype);
definesymbol(name, symtype); definesymbol(name, symtype);
if (res) { if (res) {
usesymbol(name, FALSE); usesymbol(name, 0);
addop(OP_ASSIGNBACK); addop(OP_ASSIGNBACK);
} }
return res; return res;
@@ -892,7 +912,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d
return; return;
case T_ELSE: case T_ELSE:
scanerror(T_SEMICOLON, "ELSE without preceeding IF"); scanerror(T_SEMICOLON, "ELSE without preceding IF");
return; return;
case T_SHOW: case T_SHOW:
@@ -1021,7 +1041,6 @@ getobjdeclaration(int symtype)
int count; /* number of elements */ int count; /* number of elements */
int index; /* current index */ int index; /* current index */
int i; /* loop counter */ int i; /* loop counter */
int indices[MAXINDICES]; /* indices for elements */
int oldmode; int oldmode;
if (gettoken() != T_SYMBOL) { if (gettoken() != T_SYMBOL) {
@@ -1038,23 +1057,46 @@ getobjdeclaration(int symtype)
* Read in the definition of the elements of the object. * Read in the definition of the elements of the object.
*/ */
count = 0; count = 0;
indices = quickindices;
maxindices = INDICALLOC;
oldmode = tokenmode(TM_DEFAULT); oldmode = tokenmode(TM_DEFAULT);
for (;;) { for (;;) {
switch (gettoken()) { switch (gettoken()) {
case T_SYMBOL: case T_SYMBOL:
if (count == MAXINDICES) { if (count == maxindices) {
scanerror(T_SEMICOLON, if (maxindices == INDICALLOC) {
"Too many elements in OBJ " maxindices += INDICALLOC;
"statement"); newindices = (int *) malloc(maxindices *
sizeof(int));
if (newindices == NULL) {
scanerror(T_SEMICOLON, "Out of memory for indices malloc");
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
return; return;
} }
memcpy(newindices, quickindices,
INDICALLOC * sizeof(int));
indices = newindices;
} else {
maxindices += INDICALLOC;
newindices = (int *) realloc(indices,
maxindices * sizeof(int));
if (newindices == NULL) {
free(indices);
scanerror(T_SEMICOLON, "Out of memory for indices realloc");
(void) tokenmode(oldmode);
return;
}
indices = newindices;
}
}
index = addelement(tokensymbol()); index = addelement(tokensymbol());
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (indices[i] == index) { if (indices[i] == index) {
scanerror(T_SEMICOLON, if (indices != quickindices)
"Duplicate element name " free(indices);
"\"%s\"", tokensymbol()); scanerror(T_SEMICOLON, "Duplicate element name \"%s\"", tokensymbol());
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
return; return;
} }
@@ -1064,8 +1106,9 @@ getobjdeclaration(int symtype)
continue; continue;
rescantoken(); rescantoken();
if (gettoken() != T_RIGHTBRACE) { if (gettoken() != T_RIGHTBRACE) {
scanerror(T_SEMICOLON, if (indices != quickindices)
"Bad object type definition"); free(indices);
scanerror(T_SEMICOLON, "Bad object type definition");
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
return; return;
} }
@@ -1073,23 +1116,30 @@ getobjdeclaration(int symtype)
case T_RIGHTBRACE: case T_RIGHTBRACE:
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
if (defineobject(name, indices, count)) { if (defineobject(name, indices, count)) {
if (indices != quickindices)
free(indices);
scanerror(T_NULL, scanerror(T_NULL,
"Object type \"%s\" is already defined", name); "Object type \"%s\" is already defined", name);
return; return;
} }
if (indices != quickindices)
free(indices);
getobjvars(name, symtype); getobjvars(name, symtype);
return; return;
case T_NEWLINE: case T_NEWLINE:
continue; continue;
default: default:
scanerror(T_SEMICOLON, if (indices != quickindices)
"Bad object type definition"); free(indices);
scanerror(T_SEMICOLON, "Bad object type definition");
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
return; return;
} }
} }
} }
static void static void
getoneobj(long index, int symtype) getoneobj(long index, int symtype)
{ {
@@ -1098,11 +1148,11 @@ getoneobj(long index, int symtype)
if (gettoken() == T_SYMBOL) { if (gettoken() == T_SYMBOL) {
if (symtype == SYM_UNDEFINED) { if (symtype == SYM_UNDEFINED) {
rescantoken(); rescantoken();
(void) getidexpr(TRUE, TRUE); (void) getidexpr(TRUE, 1);
} else { } else {
symname = tokensymbol(); symname = tokensymbol();
definesymbol(symname, symtype); definesymbol(symname, symtype);
usesymbol(symname, FALSE); usesymbol(symname, 0);
} }
getoneobj(index, symtype); getoneobj(index, symtype);
addop(OP_ASSIGN); addop(OP_ASSIGN);
@@ -1181,11 +1231,11 @@ getonematrix(int symtype)
if (gettoken() == T_SYMBOL) { if (gettoken() == T_SYMBOL) {
if (symtype == SYM_UNDEFINED) { if (symtype == SYM_UNDEFINED) {
rescantoken(); rescantoken();
(void) getidexpr(FALSE, TRUE); (void) getidexpr(FALSE, 1);
} else { } else {
name = tokensymbol(); name = tokensymbol();
definesymbol(name, symtype); definesymbol(name, symtype);
usesymbol(name, FALSE); usesymbol(name, 0);
} }
while (gettoken() == T_COMMA); while (gettoken() == T_COMMA);
rescantoken(); rescantoken();
@@ -2028,7 +2078,25 @@ getterm(void)
case T_SYMBOL: case T_SYMBOL:
rescantoken(); rescantoken();
type = getidexpr(TRUE, FALSE); type = getidexpr(TRUE, 0);
break;
case T_GLOBAL:
if (gettoken() != T_SYMBOL) {
scanerror(T_NULL, "Global id expected");
break;
}
rescantoken();
type = getidexpr(TRUE, T_GLOBAL);
break;
case T_LOCAL:
if (gettoken() != T_SYMBOL) {
scanerror(T_NULL, "Local id expected");
break;
}
rescantoken();
type = getidexpr(TRUE, T_LOCAL);
break; break;
case T_LEFTBRACKET: case T_LEFTBRACKET:
@@ -2077,11 +2145,11 @@ getterm(void)
/* /*
* Read in an identifier expressions. * Read in an identifier expressions.
* This is a symbol name followed by parenthesis, or by square brackets or * This is a symbol name followed by parenthesis, or by square brackets or
* element refernces. The symbol can be a global or a local variable name. * element references. The symbol can be a global or a local variable name.
* Returns the type of expression found. * Returns the type of expression found.
*/ */
static int static int
getidexpr(BOOL okmat, BOOL autodef) getidexpr(BOOL okmat, int autodef)
{ {
int type; int type;
char name[SYMBOLSIZE+1]; /* symbol name */ char name[SYMBOLSIZE+1]; /* symbol name */
@@ -2098,7 +2166,8 @@ getidexpr(BOOL okmat, BOOL autodef)
type = 0; type = 0;
break; break;
case T_ASSIGN: case T_ASSIGN:
autodef = TRUE; if (autodef != T_GLOBAL && autodef != T_LOCAL)
autodef = 1;
/* fall into default case */ /* fall into default case */
default: default:
rescantoken(); rescantoken();
@@ -2144,16 +2213,16 @@ getidexpr(BOOL okmat, BOOL autodef)
* *
* given: * given:
* name filename to read * name filename to read
* msg_ok TRUE => ok to print error messages
* once non-NULL => set to TRUE of -once read * once non-NULL => set to TRUE of -once read
*/ */
static BOOL static int
getfilename(char *name, BOOL msg_ok, BOOL *once) getfilename(char *name, BOOL *once)
{ {
STRING *s; STRING *s;
int i;
/* look at the next token */
(void) tokenmode(TM_NEWLINES | TM_ALLSYMS); (void) tokenmode(TM_NEWLINES | TM_ALLSYMS);
for (i = 2; i > 0; i--) {
switch (gettoken()) { switch (gettoken()) {
case T_STRING: case T_STRING:
s = findstring(tokenstring()); s = findstring(tokenstring());
@@ -2164,51 +2233,17 @@ getfilename(char *name, BOOL msg_ok, BOOL *once)
strcpy(name, tokensymbol()); strcpy(name, tokensymbol());
break; break;
default: default:
if (msg_ok) rescantoken();
scanerror(T_SEMICOLON, "Filename expected"); return -1;
return FALSE;
} }
/* determine if we care about a possible -once option */ if (i == 2 && once != NULL) {
if (once != NULL) { if ((*once = !strcmp(name, "-once")))
/* we care about a possible -once option */ continue;
if (strcmp(name, "-once") == 0) { }
/* -once option found */
*once = TRUE;
/* look for the filename */
switch (gettoken()) {
case T_STRING:
s = findstring(tokenstring());
strcpy(name, s->s_str);
sfree(s);
break; break;
case T_SYMBOL:
strcpy(name, tokensymbol());
break;
default:
if (msg_ok)
scanerror(T_SEMICOLON,
"Filename expected");
return FALSE;
} }
} else { return 0;
*once = FALSE;
}
}
/* look at the next token */
switch (gettoken()) {
case T_SEMICOLON:
case T_NEWLINE:
case T_EOF:
break;
default:
if (msg_ok)
scanerror(T_SEMICOLON,
"Missing semicolon after filename");
return FALSE;
}
return TRUE;
} }
@@ -2433,11 +2468,26 @@ definesymbol(char *name, int symtype)
* *
* given: * given:
* name symbol name to be checked * name symbol name to be checked
* autodef TRUE => define is symbol is not known * autodef 1 => define if symbol is not known
* T_GLOBAL => get global, define if necessary
*/ */
static void static void
usesymbol(char *name, BOOL autodef) usesymbol(char *name, int autodef)
{ {
if (autodef == T_GLOBAL) {
addopptr(OP_GLOBALADDR, (char *) addglobal(name, FALSE));
return;
}
if (autodef == T_LOCAL) {
if (symboltype(name) == SYM_PARAM) {
scanerror(T_COMMA,
"Variable \"%s\" is already defined", name);
return;
}
addopone(OP_LOCALADDR, addlocal(name));
return;
}
switch (symboltype(name)) { switch (symboltype(name)) {
case SYM_LOCAL: case SYM_LOCAL:
addopone(OP_LOCALADDR, (long) findlocal(name)); addopone(OP_LOCALADDR, (long) findlocal(name));
@@ -2544,24 +2594,25 @@ static void
do_changedir(void) do_changedir(void)
{ {
char *p; char *p;
STRING *s;
/* look at the next token */ /* look at the next token */
(void) tokenmode(TM_NEWLINES | TM_ALLSYMS); (void) tokenmode(TM_NEWLINES | TM_ALLSYMS);
/* determine the new directory */ /* determine the new directory */
s = NULL;
switch (gettoken()) { switch (gettoken()) {
case T_NULL: case T_STRING:
case T_NEWLINE: s = findstring(tokenstring());
case T_SEMICOLON: p = s->s_str;
p = home; break;
case T_SYMBOL:
p = tokensymbol();
break; break;
default: default:
p = tokensymbol(); /* This is not enough XXX */
if (p == NULL) {
p = home; p = home;
} }
break;
}
if (p == NULL) { if (p == NULL) {
fprintf(stderr, "Cannot determine HOME directory\n"); fprintf(stderr, "Cannot determine HOME directory\n");
} }
@@ -2570,29 +2621,8 @@ do_changedir(void)
if (chdir(p)) { if (chdir(p)) {
perror(p); perror(p);
} }
return; if (s != NULL)
sfree(s);
} }
/*
* getshellfile - process the contents of a shellfile
*/
void
getshellfile(char *shellfile)
{
/*
* treat the calc shell script as if we were reading it
*/
if (!allow_read) {
scanerror(T_NULL,
"reading of calc shell script \"%s\" "
"dislloaed by -m mode\n", shellfile);
} else if (opensearchfile(shellfile, NULL, NULL, FALSE) == 0) {
getcommands(FALSE);
closeinput();
} else {
scanerror(T_NULL,
"Cannot open calc shell script \"%s\"\n", shellfile);
}
return;
}

View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: comfunc.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ * @(#) $Id: comfunc.c,v 29.2 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/comfunc.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/comfunc.c,v $
* *
* Under source code control: 1990/02/15 01:48:13 * Under source code control: 1990/02/15 01:48:13
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -1007,7 +1007,7 @@ cpolar(NUMBER *q1, NUMBER *q2, NUMBER *epsilon)
long m, n; long m, n;
if (qiszero(epsilon)) { if (qiszero(epsilon)) {
math_error("Zero epsilson for cpolar"); math_error("Zero epsilon for cpolar");
/*NOTREACHED*/ /*NOTREACHED*/
} }
if (qiszero(q1)) if (qiszero(q1))
@@ -1162,3 +1162,27 @@ cprintfr(COMPLEX *c)
zprintval(i->den, 0L, 0L); zprintval(i->den, 0L, 0L);
} }
} }
NUMBER *
cilog(COMPLEX *c, ZVALUE base)
{
NUMBER *qr, *qi;
qr = qilog(c->real, base);
qi = qilog(c->imag, base);
if (qr == NULL) {
if (qi == NULL)
return NULL;
return qi;
}
if (qi == NULL)
return qr;
if (qrel(qr, qi) >= 0) {
qfree(qi);
return qr;
}
qfree(qr);
return qi;
}

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: commath.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ * @(#) $Id: commath.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $
* *
* Under source code control: 1990/02/15 01:48:10 * Under source code control: 1990/02/15 01:48:10
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

246
config.c
View File

@@ -19,14 +19,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.2 $ * @(#) $Revision: 29.3 $
* @(#) $Id: config.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ * @(#) $Id: config.c,v 29.3 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $
* *
* Under source code control: 1991/07/20 00:21:56 * Under source code control: 1991/07/20 00:21:56
* File existed as early as: 1991 * File existed as early as: 1991
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -109,10 +109,10 @@ CONFIG oldstd = { /* backward compatible standard configuration */
SQ_ALG2, /* size of number to use square alg 2 */ SQ_ALG2, /* size of number to use square alg 2 */
POW_ALG2, /* size of modulus to use REDC for powers */ POW_ALG2, /* size of modulus to use REDC for powers */
REDC_ALG2, /* size of modulus to use REDC algorithm 2 */ REDC_ALG2, /* size of modulus to use REDC algorithm 2 */
TRUE, /* ok to print a tilde on aproximations */ TRUE, /* ok to print a tilde on approximations */
TRUE, /* ok to print tab before numeric values */ TRUE, /* ok to print tab before numeric values */
0, /* quomod() default rounding mode */ 0, /* quomod() default rounding mode */
2, /* quotent // default rounding mode */ 2, /* quotient // default rounding mode */
0, /* mod % default rounding mode */ 0, /* mod % default rounding mode */
24, /* sqrt() default rounding mode */ 24, /* sqrt() default rounding mode */
24, /* appr() default rounding mode */ 24, /* appr() default rounding mode */
@@ -149,10 +149,10 @@ CONFIG newstd = { /* new non-backward compatible configuration */
SQ_ALG2, /* size of number to use square alg 2 */ SQ_ALG2, /* size of number to use square alg 2 */
POW_ALG2, /* size of modulus to use REDC for powers */ POW_ALG2, /* size of modulus to use REDC for powers */
REDC_ALG2, /* size of modulus to use REDC algorithm 2 */ REDC_ALG2, /* size of modulus to use REDC algorithm 2 */
TRUE, /* ok to print a tilde on aproximations */ TRUE, /* ok to print a tilde on approximations */
TRUE, /* ok to print tab before numeric values */ TRUE, /* ok to print tab before numeric values */
0, /* quomod() default rounding mode */ 0, /* quomod() default rounding mode */
0, /* quotent // default rounding mode */ 0, /* quotient // default rounding mode */
0, /* mod % default rounding mode */ 0, /* mod % default rounding mode */
24, /* sqrt() default rounding mode */ 24, /* sqrt() default rounding mode */
24, /* appr() default rounding mode */ 24, /* appr() default rounding mode */
@@ -287,10 +287,11 @@ static NAMETYPE truth[] = {
/* /*
* declate static functions * declare static functions
*/ */
static long lookup_long(NAMETYPE *set, char *name); static long lookup_long(NAMETYPE *set, char *name);
static char *lookup_name(NAMETYPE *set, long val); static char *lookup_name(NAMETYPE *set, long val);
static int getlen(VALUE *vp, LEN *lp);
/* /*
@@ -360,6 +361,26 @@ lookup_name(NAMETYPE *set, long val)
} }
/*
* Check whether VALUE at vp is a LEN (32-bit signed integer) and if so,
* copy that integer to lp.
* Return: 1, 2, 0, or -1 XXX
*/
static int
getlen(VALUE *vp, LEN *lp)
{
if (vp->v_type != V_NUM || !qisint(vp->v_num))
return 1;
if (zge31b(vp->v_num->num))
return 2;
*lp = ztoi(vp->v_num->num);
if (*lp < 0)
return -1;
return 0;
}
/* /*
* Set the specified configuration type to the specified value. * Set the specified configuration type to the specified value.
* An error is generated if the type number or value is illegal. * An error is generated if the type number or value is illegal.
@@ -370,6 +391,7 @@ setconfig(int type, VALUE *vp)
NUMBER *q; NUMBER *q;
CONFIG *newconf; /* new configuration to set */ CONFIG *newconf; /* new configuration to set */
long temp; long temp;
LEN len;
char *p; char *p;
switch (type) { switch (type) {
@@ -414,15 +436,11 @@ setconfig(int type, VALUE *vp)
break; break;
case CONFIG_DISPLAY: case CONFIG_DISPLAY:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for display"); math_error("Bad value for display");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; math_setdigits(len);
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num))
temp = -1;
math_setdigits(temp);
break; break;
case CONFIG_MODE: case CONFIG_MODE:
@@ -447,91 +465,51 @@ setconfig(int type, VALUE *vp)
break; break;
case CONFIG_MAXPRINT: case CONFIG_MAXPRINT:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for maxprint"); math_error("Bad value for maxprint");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->maxprint = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num))
temp = -1;
if (temp < 0) {
math_error("Maxprint value is out of range");
/*NOTREACHED*/
}
conf->maxprint = temp;
break; break;
case CONFIG_MUL2: case CONFIG_MUL2:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for mul2"); math_error("Bad value for mul2");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; if (len == 0)
temp = qtoi(q); len = MUL_ALG2;
if (qisfrac(q) || qisneg(q)) conf->mul2 = len;
temp = -1;
if (temp == 0)
temp = MUL_ALG2;
if (temp < 2) {
math_error("Illegal mul2 value");
/*NOTREACHED*/
}
conf->mul2 = (int)temp;
break; break;
case CONFIG_SQ2: case CONFIG_SQ2:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for sq2"); math_error("Bad value for sq2");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; if (len == 0)
temp = qtoi(q); len = SQ_ALG2;
if (qisfrac(q) || qisneg(q)) conf->sq2 = len;
temp = -1;
if (temp == 0)
temp = SQ_ALG2;
if (temp < 2) {
math_error("Illegal sq2 value");
/*NOTREACHED*/
}
conf->sq2 = (int)temp;
break; break;
case CONFIG_POW2: case CONFIG_POW2:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for pow2"); math_error("Bad value for pow2");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; if (len == 0)
temp = qtoi(q); len = POW_ALG2;
if (qisfrac(q) || qisneg(q)) conf->pow2 = len;
temp = -1;
if (temp == 0)
temp = POW_ALG2;
if (temp < 1) {
math_error("Illegal pow2 value");
/*NOTREACHED*/
}
conf->pow2 = (int)temp;
break; break;
case CONFIG_REDC2: case CONFIG_REDC2:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non-numeric for redc2"); math_error("Bad value for redc2");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; if (len == 0)
temp = qtoi(q); len = REDC_ALG2;
if (qisfrac(q) || qisneg(q)) conf->redc2 = len;
temp = -1;
if (temp == 0)
temp = REDC_ALG2;
if (temp < 1) {
math_error("Illegal redc2 value");
/*NOTREACHED*/
}
conf->redc2 = (int)temp;
break; break;
case CONFIG_TILDE: case CONFIG_TILDE:
@@ -563,129 +541,75 @@ setconfig(int type, VALUE *vp)
break; break;
case CONFIG_QUOMOD: case CONFIG_QUOMOD:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for quomod"); math_error("Illegal value for quomod");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->quomod = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal quomod parameter value");
/*NOTREACHED*/
}
conf->quomod = temp;
break; break;
case CONFIG_QUO: case CONFIG_QUO:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for quo"); math_error("Illegal value for quo");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->quo = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal quo parameter value");
/*NOTREACHED*/
}
conf->quo = temp;
break; break;
case CONFIG_MOD: case CONFIG_MOD:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for mod"); math_error("Illegal value for mod");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->mod = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal mod parameter value");
/*NOTREACHED*/
}
conf->mod = temp;
break; break;
case CONFIG_SQRT: case CONFIG_SQRT:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for sqrt"); math_error("Illegal value for sqrt");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->sqrt = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal sqrt parameter value");
/*NOTREACHED*/
}
conf->sqrt = temp;
break; break;
case CONFIG_APPR: case CONFIG_APPR:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for appr"); math_error("Illegal value for appr");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->appr = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal appr parameter value");
/*NOTREACHED*/
}
conf->appr = temp;
break; break;
case CONFIG_CFAPPR: case CONFIG_CFAPPR:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for cfappr"); math_error("Illegal value for cfappr");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->cfappr = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal cfappr parameter value");
/*NOTREACHED*/
}
conf->cfappr = temp;
break; break;
case CONFIG_CFSIM: case CONFIG_CFSIM:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for cfsim"); math_error("Illegal value for cfsim");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->cfsim = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal cfsim parameter value");
/*NOTREACHED*/
}
conf->cfsim = temp;
break; break;
case CONFIG_OUTROUND: case CONFIG_OUTROUND:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for outround"); math_error("Illegal value for outround");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->outround = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal output parameter value");
/*NOTREACHED*/
}
conf->outround = temp;
break; break;
case CONFIG_ROUND: case CONFIG_ROUND:
if (vp->v_type != V_NUM) { if (getlen(vp, &len)) {
math_error("Non numeric for round"); math_error("Illegal value for round");
/*NOTREACHED*/ /*NOTREACHED*/
} }
q = vp->v_num; conf->round = len;
temp = qtoi(q);
if (qisfrac(q) || qisneg(q) || !zistiny(q->num)) {
math_error("Illegal output parameter value");
/*NOTREACHED*/
}
conf->round = temp;
break; break;
case CONFIG_LEADZERO: case CONFIG_LEADZERO:
@@ -1311,12 +1235,12 @@ config_cmp(CONFIG *cfg1, CONFIG *cfg2)
*/ */
if (cfg1 == NULL || cfg1->epsilon == NULL || cfg1->prompt1 == NULL || if (cfg1 == NULL || cfg1->epsilon == NULL || cfg1->prompt1 == NULL ||
cfg1->prompt2 == NULL) { cfg1->prompt2 == NULL) {
math_error("CONFIG #1 value is invaid"); math_error("CONFIG #1 value is invalid");
/*NOTREACHED*/ /*NOTREACHED*/
} }
if (cfg2 == NULL || cfg2->epsilon == NULL || cfg2->prompt1 == NULL || if (cfg2 == NULL || cfg2->epsilon == NULL || cfg2->prompt1 == NULL ||
cfg2->prompt2 == NULL) { cfg2->prompt2 == NULL) {
math_error("CONFIG #2 value is invaid"); math_error("CONFIG #2 value is invalid");
/*NOTREACHED*/ /*NOTREACHED*/
} }

View File

@@ -19,15 +19,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.2 $ * @(#) $Revision: 29.3 $
* @(#) $Id: config.h,v 29.2 1999/12/14 19:37:46 chongo Exp $ * @(#) $Id: config.h,v 29.3 2000/06/07 14:02:13 chongo Exp chongo $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $
* *
* Under source code control: 1995/11/01 22:20:17 * Under source code control: 1995/11/01 22:20:17
* File existed as early as: 1995 * File existed as early as: 1995
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
@@ -110,26 +110,26 @@
*/ */
struct config { struct config {
int outmode; /* current output mode */ int outmode; /* current output mode */
long outdigits; /* current output digits for float or exp */ LEN outdigits; /* current output digits for float or exp */
NUMBER *epsilon; /* default error for real functions */ NUMBER *epsilon; /* default error for real functions */
long epsilonprec; /* epsilon binary precision (tied to epsilon) */ long epsilonprec; /* epsilon binary precision (tied to epsilon) */
FLAG traceflags; /* tracing flags */ FLAG traceflags; /* tracing flags */
long maxprint; /* number of elements to print */ LEN maxprint; /* number of elements to print */
LEN mul2; /* size of number to use multiply algorithm 2 */ LEN mul2; /* size of number to use multiply algorithm 2 */
LEN sq2; /* size of number to use square algorithm 2 */ LEN sq2; /* size of number to use square algorithm 2 */
LEN pow2; /* size of modulus to use REDC for powers */ LEN pow2; /* size of modulus to use REDC for powers */
LEN redc2; /* size of modulus to use REDC algorithm 2 */ LEN redc2; /* size of modulus to use REDC algorithm 2 */
BOOL tilde_ok; /* ok to print a tilde on aproximations */ BOOL tilde_ok; /* ok to print a tilde on aproximations */
BOOL tab_ok; /* ok to print tab before numeric values */ BOOL tab_ok; /* ok to print tab before numeric values */
long quomod; /* quomod() default rounding mode */ LEN quomod; /* quomod() default rounding mode */
long quo; /* quotent // default rounding mode */ LEN quo; /* quotient // default rounding mode */
long mod; /* mod % default rounding mode */ LEN mod; /* mod % default rounding mode */
long sqrt; /* sqrt() default rounding mode */ LEN sqrt; /* sqrt() default rounding mode */
long appr; /* appr() default rounding mode */ LEN appr; /* appr() default rounding mode */
long cfappr; /* cfappr() default rounding mode */ LEN cfappr; /* cfappr() default rounding mode */
long cfsim; /* cfsim() default rounding mode */ LEN cfsim; /* cfsim() default rounding mode */
long outround; /* output default rounding mode */ LEN outround; /* output default rounding mode */
long round; /* round()/bround() default rounding mode */ LEN round; /* round()/bround() default rounding mode */
BOOL leadzero; /* ok to print leading 0 before decimal pt */ BOOL leadzero; /* ok to print leading 0 before decimal pt */
BOOL fullzero; /* ok to print trailing 0's */ BOOL fullzero; /* ok to print trailing 0's */
long maxscancount; /* max scan errors before abort */ long maxscancount; /* max scan errors before abort */

View File

@@ -17,14 +17,14 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: const.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ * @(#) $Id: const.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/const.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/const.c,v $
* *
* Under source code control: 1990/02/15 01:48:14 * Under source code control: 1990/02/15 01:48:14
* File existed as early as: before 1990 * File existed as early as: before 1990
* *
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.3 $ # @(#) $Revision: 29.5 $
# @(#) $Id: Makefile,v 29.3 1999/12/14 19:30:19 chongo Exp $ # @(#) $Id: Makefile,v 29.5 2000/06/07 14:02:59 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $
# #
# Under source code control: 1999/11/29 11:10:26 # Under source code control: 1999/11/29 11:10:26
# File existed as early as: 1999 # File existed as early as: 1999
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
# calculator by David I. Bell with help/mods from others # calculator by David I. Bell with help/mods from others
# Makefile by Landon Curt Noll # Makefile by Landon Curt Noll
@@ -82,7 +82,7 @@ SCRIPT_SRC= mersenne.calc piforever.calc plus.calc simple.calc
# These files are found (but not built) in the distribution # These files are found (but not built) in the distribution
# #
DISTLIST= ${SCRIPT_SRC} ${MAKE_FILE} DISTLIST= ${SCRIPT_SRC} ${MAKE_FILE} README
# These files are used to make (but not built) a calc .a library # These files are used to make (but not built) a calc .a library
# #

65
cscript/README Normal file
View File

@@ -0,0 +1,65 @@
calc shell script examples
--------------------------
These calc shell scripts are provided because they serve as examples of
how use the calc language, and/or because the authors thought them to
be useful!
If you write something that you think is useful, please send it to:
calc-contrib at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
For more info, see:
help script
help cscript
=-=
mersenne exp
Print the value of 2^exp-1.
piforever
Print the value of pi forever, or as long as you cpu / memory allows.
plus arg ...
Print the sum of 1 or more arguments.
simple
A trivial example of a calc shell script.
## Copyright (C) 1999 Landon Curt Noll
##
## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License
## as published by the Free Software Foundation.
##
## Calc is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
## Public License for more details.
##
## A copy of version 2.1 of the GNU Lesser General Public License is
## distributed with calc under the filename COPYING-LGPL. You should have
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
##
## @(#) $Revision: 29.4 $
## @(#) $Id: README,v 29.4 2000/06/07 14:02:59 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/README,v $
##
## Under source code control: 1999/12/17 10:23:40
## File existed as early as: 1999
##
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: mersenne.calc,v 29.1 1999/12/14 09:15:35 chongo Exp $ # @(#) $Id: mersenne.calc,v 29.2 2000/06/07 14:02:59 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/mersenne.calc,v $ # @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/mersenne.calc,v $
# #
# Under source code control: 1999/11/30 00:09:01; # Under source code control: 1999/11/30 00:09:01;
# File existed as early as: 1999 # File existed as early as: 1999
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# usage: # usage:
# mersenne exp # mersenne exp

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: piforever.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ # @(#) $Id: piforever.calc,v 29.2 2000/06/07 14:02:59 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/piforever.calc,v $ # @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/piforever.calc,v $
# #
# Under source code control: 1999/11/30 00:11:36 # Under source code control: 1999/11/30 00:11:36
# File existed as early as: 1999 # File existed as early as: 1999
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# usage: # usage:
# piforever # piforever

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: plus.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ # @(#) $Id: plus.calc,v 29.2 2000/06/07 14:02:59 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/plus.calc,v $ # @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/plus.calc,v $
# #
# Under source code control: 1999/11/29 10:22:37 # Under source code control: 1999/11/29 10:22:37
# File existed as early as: 1999 # File existed as early as: 1999
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# usage: # usage:
# plus val ... # plus val ...

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: simple.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ # @(#) $Id: simple.calc,v 29.2 2000/06/07 14:02:59 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/simple.calc,v $ # @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/simple.calc,v $
# #
# Under source code control: 1999/11/29 10:22:37 # Under source code control: 1999/11/29 10:22:37
# File existed as early as: 1999 # File existed as early as: 1999
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
/* /*

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: custom.c,v 29.1 1999/12/14 09:15:36 chongo Exp $ * @(#) $Id: custom.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.c,v $
* *
* Under source code control: 1997/03/03 04:53:08 * Under source code control: 1997/03/03 04:53:08
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: custom.h,v 29.1 1999/12/14 09:15:36 chongo Exp $ * @(#) $Id: custom.h,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.h,v $
* *
* Under source code control: 1997/03/03 04:53:08 * Under source code control: 1997/03/03 04:53:08
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

View File

@@ -57,12 +57,12 @@ pzasusb8.cal
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: CUSTOM_CAL,v 29.1 1999/12/14 09:15:36 chongo Exp $ ## @(#) $Id: CUSTOM_CAL,v 29.2 2000/06/07 14:03:03 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/CUSTOM_CAL,v $ ## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/CUSTOM_CAL,v $
## ##
## Under source code control: 1997/03/08 20:51:32 ## Under source code control: 1997/03/08 20:51:32
## File existed as early as: 1997 ## File existed as early as: 1997
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -635,12 +635,12 @@ Step 12: Contribute
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: HOW_TO_ADD,v 29.1 1999/12/14 09:15:36 chongo Exp $ ## @(#) $Id: HOW_TO_ADD,v 29.2 2000/06/07 14:03:03 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/HOW_TO_ADD,v $ ## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/HOW_TO_ADD,v $
## ##
## Under source code control: 1997/03/10 03:03:21 ## Under source code control: 1997/03/10 03:03:21
## File existed as early as: 1997 ## File existed as early as: 1997
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -18,15 +18,15 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
# @(#) $Revision: 29.1 $ # @(#) $Revision: 29.2 $
# @(#) $Id: Makefile,v 29.1 1999/12/14 09:15:36 chongo Exp $ # @(#) $Id: Makefile,v 29.2 2000/06/07 14:03:03 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
# File existed as early as: 1997 # File existed as early as: 1997
# #
# chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# #
# calculator by David I. Bell with help/mods from others # calculator by David I. Bell with help/mods from others
# Makefile by Landon Curt Noll # Makefile by Landon Curt Noll

View File

@@ -56,12 +56,12 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## ##
## @(#) $Revision: 29.1 $ ## @(#) $Revision: 29.2 $
## @(#) $Id: argv,v 29.1 1999/12/14 09:15:36 chongo Exp $ ## @(#) $Id: argv,v 29.2 2000/06/07 14:03:03 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv,v $ ## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv,v $
## ##
## Under source code control: 1997/03/09 20:28:01 ## Under source code control: 1997/03/09 20:28:01
## File existed as early as: 1997 ## File existed as early as: 1997
## ##
## chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/

View File

@@ -17,15 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* @(#) $Revision: 29.1 $ * @(#) $Revision: 29.2 $
* @(#) $Id: argv.cal,v 29.1 1999/12/14 09:15:36 chongo Exp $ * @(#) $Id: argv.cal,v 29.2 2000/06/07 14:03:03 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv.cal,v $ * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv.cal,v $
* *
* Under source code control: 1997/03/10 00:27:17 * Under source code control: 1997/03/10 00:27:17
* File existed as early as: 1997 * File existed as early as: 1997
* *
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/ * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
/* /*

Some files were not shown because too many files have changed in this diff Show More