Release calc version 2.11.6.2

This commit is contained in:
Landon Curt Noll
2003-02-25 12:07:57 -08:00
parent b60eec99bb
commit 8aedcf801a
16 changed files with 289 additions and 74 deletions

49
CHANGES
View File

@@ -38,9 +38,52 @@ The following are the changes from calc version 2.11.6.0 to date:
By default, base2() is disabled. Calling base2(0) will also turn By default, base2() is disabled. Calling base2(0) will also turn
off the double base mode. Thanks goes to Erik Anggard off the double base mode. Thanks goes to Erik Anggard
<eriki dot anggardi at packetfronti dot com> for his idea and <erik dot anggard at packetfront dot com> for his idea and
his initial patch. his initial patch.
Added repeat.cal as a calc resource file script:
repeat(digit_set, repeat_count)
Return the value of the digit_set repeated repeat_count times.
Both digit_set and repeat_count must be integers > 0.
For example repeat(423,5) returns the value 423423423423423,
which is the digit_set 423 repeated 5 times.
Makefile no longer makes a direct reference to Red Hat 6.0.
Added missing math_setmode2() prototype to zmath.h.
Fixed some implicit declarations of functions by either making
them explicit or by including the proper system .h files.
Makefile no longer uses -Wno-implicit flag, by default, for
gcc based compiles on calc source. Makefile now attempts to
compile no_implicit.c with an explicit -Wno-implicit arg in an
effort to determine of -Wno-implicit is a valid compiler flag.
If no_implicit.c is compiled with -Wno-implicit, then
the file no_implicit.arg is created with the contents
of the -Wno-implicit flag. Otherwise no_implicit.arg
is created as an empty file.
Added the Makefile variable ${HAVE_NO_IMPLICIT}, which if
not set to YES will prevent no_implicit.c from being
compiled and prevent the -Wno-implicit flag from being used.
If ${HAVE_NO_IMPLICIT} is not YES, then an empty no_implicit.arg
file is created and no_implicit.c is not compiled.
The seed.c file, because the pseudo_seed() function contains
calls to a number of various system functions, attempts to
compile with the -Wno-implicit flag (if allowed by the
formation of the no_implicit.arg file).
Misc make depend fixes and cleanup.
Fixed formation of the custom/.all file.
Fixed repeat(1, repeat_count) bug.
The following are the changes from calc version 2.11.5.5 to 2.11.5.9: The following are the changes from calc version 2.11.5.5 to 2.11.5.9:
@@ -5465,8 +5508,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
## 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.50 $ ## @(#) $Revision: 29.54 $
## @(#) $Id: CHANGES,v 29.50 2002/12/29 09:22:43 chongo Exp $ ## @(#) $Id: CHANGES,v 29.54 2003/01/14 04:04:26 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $
## ##
## Under source code control: 1993/06/02 18:12:57 ## Under source code control: 1993/06/02 18:12:57

View File

@@ -20,8 +20,8 @@
# 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.
# #
MAKEFILE_REV= $$Revision: 29.48 $$ MAKEFILE_REV= $$Revision: 29.53 $$
# @(#) $Id: Makefile.ship,v 29.48 2002/12/29 07:13:50 chongo Exp $ # @(#) $Id: Makefile.ship,v 29.53 2003/01/14 02:33:07 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
@@ -541,6 +541,16 @@ HAVE_UNISTD_H=
#HAVE_UNISTD_H= YES #HAVE_UNISTD_H= YES
#HAVE_UNISTD_H= NO #HAVE_UNISTD_H= NO
# Determine if our compiler allows the -Wno-implicit flag
#
# HAVE_NO_IMPLICIT= Our compiler does not have -Wno-implicit flags
# HAVE_NO_IMPLICIT= NO Our compiler does not have -Wno-implicit flags
# HAVE_NO_IMPLICIT= YES Our compiler has a -Wno-implicit flag
#
# HAVE_NO_IMPLICIT=
# HAVE_NO_IMPLICIT= NO
HAVE_NO_IMPLICIT= YES
# System include files # System include files
# #
# ${INCDIR} where the system include (.h) files are kept # ${INCDIR} where the system include (.h) files are kept
@@ -955,7 +965,7 @@ ALLOW_CUSTOM= -DCUSTOM
# For better performance, set the following above: DEBUG= -O2 -g3 # For better performance, set the following above: DEBUG= -O2 -g3
# You might even try: DEBUG= -O3 -g3 # You might even try: DEBUG= -O3 -g3
# #
CCWARN= -Wall -Wno-implicit -Wno-comment CCWARN= -Wall -Wno-comment
CCOPT= ${DEBUG} ${NO_SHARED} CCOPT= ${DEBUG} ${NO_SHARED}
CCMISC= CCMISC=
# #
@@ -975,7 +985,7 @@ CC= ${PURIFY} ${LCC}
# For better performance, set the following above: DEBUG= -O2 -g3 # For better performance, set the following above: DEBUG= -O2 -g3
# You might even try: DEBUG= -O3 -g3 # You might even try: DEBUG= -O3 -g3
# #
#CCWARN= -Wall -Wno-implicit -Wno-comment #CCWARN= -Wall -Wno-comment
#CCOPT= ${DEBUG} ${NO_SHARED} #CCOPT= ${DEBUG} ${NO_SHARED}
#CCMISC= #CCMISC=
# #
@@ -1104,7 +1114,7 @@ CC= ${PURIFY} ${LCC}
# For better performance, set the following above: DEBUG= -O2 -g3 # For better performance, set the following above: DEBUG= -O2 -g3
# You might even try: DEBUG= -O3 -g3 # You might even try: DEBUG= -O3 -g3
# #
#CCWARN= -Wall -Wno-implicit -Wno-comment #CCWARN= -Wall -Wno-comment
#CCOPT= ${DEBUG} ${NO_SHARED} #CCOPT= ${DEBUG} ${NO_SHARED}
#CCMISC= #CCMISC=
# #
@@ -1249,7 +1259,8 @@ UTIL_C_SRC= align32.c endian.c longbits.c have_newstr.c have_uid_t.c \
have_const.c have_stdvs.c have_varvs.c fposval.c have_fpos.c \ have_const.c have_stdvs.c have_varvs.c fposval.c have_fpos.c \
have_fpos_pos.c longlong.c have_offscl.c have_posscl.c have_memmv.c \ have_fpos_pos.c longlong.c have_offscl.c have_posscl.c have_memmv.c \
have_ustat.c have_getsid.c have_getpgid.c \ have_ustat.c have_getsid.c have_getpgid.c \
have_gettime.c have_getprid.c have_rusage.c have_strdup.c have_gettime.c have_getprid.c have_rusage.c have_strdup.c \
no_implicit.c
# these awk and sed tools are used in the process of building BUILD_H_SRC # these awk and sed tools are used in the process of building BUILD_H_SRC
# and BUILD_C_SRC # and BUILD_C_SRC
@@ -1265,7 +1276,8 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \
have_const.o fposval.o have_fpos.o have_fpos_pos.o longlong.o \ have_const.o fposval.o have_fpos.o have_fpos_pos.o longlong.o \
try_strarg.o have_stdvs.o have_varvs.o have_posscl.o have_memmv.o \ try_strarg.o have_stdvs.o have_varvs.o have_posscl.o have_memmv.o \
have_ustat.o have_getsid.o have_getpgid.o \ have_ustat.o have_getsid.o have_getpgid.o \
have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \
no_implicit.o
# these temp files may be created (and removed) during the build of BUILD_C_SRC # these temp files may be created (and removed) during the build of BUILD_C_SRC
# #
@@ -1273,12 +1285,13 @@ UTIL_TMP= ll_tmp fpos_tmp fposv_tmp const_tmp uid_tmp newstr_tmp vs_tmp \
memmv_tmp offscl_tmp posscl_tmp newstr_tmp \ memmv_tmp offscl_tmp posscl_tmp newstr_tmp \
getsid_tmp gettime_tmp getprid_tmp rusage_tmp strdup_tmp getsid_tmp gettime_tmp getprid_tmp rusage_tmp strdup_tmp
# these utility progs may be used in the process of building BUILD_H_SRC # these utility progs may be created in the process of building BUILD_H_SRC
# #
UTIL_PROGS= align32 fposval have_uid_t longlong have_const \ UTIL_PROGS= align32 fposval have_uid_t longlong have_const \
endian longbits have_newstr have_stdvs have_varvs \ endian longbits have_newstr have_stdvs have_varvs \
have_ustat have_getsid have_getpgid \ have_ustat have_getsid have_getpgid \
have_gettime have_getprid ver_calc have_strdup have_gettime have_getprid ver_calc have_strdup \
no_implicit no_implicit.arg
# The complete list of Makefile vars passed down to custom/Makefile. # The complete list of Makefile vars passed down to custom/Makefile.
# #
@@ -1525,6 +1538,9 @@ hist.o: hist.c ${MAKE_FILE}
func.o: func.c ${MAKE_FILE} func.o: func.c ${MAKE_FILE}
${CC} ${CFLAGS} ${ALLOW_CUSTOM} -c func.c ${CC} ${CFLAGS} ${ALLOW_CUSTOM} -c func.c
seed.o: seed.c no_implicit.arg ${MAKE_FILE}
${CC} ${CFLAGS} "`cat no_implicit.arg`" -c seed.c
## ##
# #
# The next set of rules cause the .h files BUILD_H_SRC files to be built # The next set of rules cause the .h files BUILD_H_SRC files to be built
@@ -2850,6 +2866,29 @@ calcerr.c: calcerr.tbl calcerr_c.sed calcerr_c.awk ${MAKE_FILE}
true; \ true; \
fi fi
no_implicit.arg: no_implicit.c ${MAKE_FILE}
-${Q}rm -f no_implicit no_implicit.o no_implicit.arg
${Q}echo 'forming no_implicit.arg'
-${Q}if [ X"${HAVE_NO_IMPLICIT}" = X"YES" ]; then \
${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \
no_implicit.c -c >/dev/null 2>&1; \
${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit >/dev/null 2>&1; \
${SHELL} -c "./no_implicit > no_implicit.arg 2>/dev/null" \
>/dev/null 2>&1; true; \
else \
touch no_implicit.arg; \
fi
${Q}echo 'no_implicit.arg formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
cat $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
true; \
fi
## ##
# #
# Build .h files for windoz based systems # Build .h files for windoz based systems
@@ -2932,6 +2971,13 @@ ${CSCRIPT_TARGETS}:
sample/.all: ${SAMPLE_TARGETS} sample/.all: ${SAMPLE_TARGETS}
custom/.all:
${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-='
${V} echo '=-=-=-=-= Invoking all rule for custom =-=-=-=-='
cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} all
${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-='
${SAMPLE_TARGETS}: libcalc.a ${SAMPLE_TARGETS}: libcalc.a
${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-='
${V} echo '=-=-=-=-= Invoking all rule for cscript =-=-=-=-=' ${V} echo '=-=-=-=-= Invoking all rule for cscript =-=-=-=-='
@@ -3033,7 +3079,8 @@ depend: hsrc
-${Q}rm -rf skel -${Q}rm -rf skel
${Q}mkdir skel ${Q}mkdir skel
-${Q}for i in ${C_SRC} ${BUILD_C_SRC}; do \ -${Q}for i in ${C_SRC} ${BUILD_C_SRC}; do \
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" > "skel/$$i"; \ ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \
${GREP} -v '\.\./getopt/getopt\.h' > "skel/$$i"; \
done done
${Q}mkdir skel/custom ${Q}mkdir skel/custom
-${Q}for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \ -${Q}for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \
@@ -3801,7 +3848,6 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.
addop.o: addop.c addop.o: addop.c
addop.o: alloc.h addop.o: alloc.h
addop.o: block.h addop.o: block.h
@@ -4115,6 +4161,7 @@ custom.o: value.h
custom.o: win32dll.h custom.o: win32dll.h
custom.o: zmath.h custom.o: zmath.h
endian.o: endian.c endian.o: endian.c
endian.o: have_stdlib.h
endian.o: have_unistd.h endian.o: have_unistd.h
file.o: alloc.h file.o: alloc.h
file.o: block.h file.o: block.h
@@ -4525,6 +4572,7 @@ md5.o: string.h
md5.o: value.h md5.o: value.h
md5.o: win32dll.h md5.o: win32dll.h
md5.o: zmath.h md5.o: zmath.h
no_implicit.o: no_implicit.c
obj.o: alloc.h obj.o: alloc.h
obj.o: block.h obj.o: block.h
obj.o: byteswap.h obj.o: byteswap.h

View File

@@ -18,8 +18,8 @@
# 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.14 $ # @(#) $Revision: 29.15 $
# @(#) $Id: Makefile,v 29.14 2002/03/14 00:28:28 chongo Exp $ # @(#) $Id: Makefile,v 29.15 2003/01/05 08:10:56 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
@@ -175,8 +175,8 @@ CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \
test2700.cal test3100.cal test3300.cal test3400.cal prompt.cal \ test2700.cal test3100.cal test3300.cal test3400.cal prompt.cal \
test3500.cal seedrandom.cal test4000.cal test4100.cal test4600.cal \ test3500.cal seedrandom.cal test4000.cal test4100.cal test4600.cal \
beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \ beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \
randomrun.cal xx_print.cal natnumset.cal qtime.cal test8400.cal \ randomrun.cal repeat.cal xx_print.cal natnumset.cal qtime.cal \
test8500.cal test8600.cal chi.cal intfile.cal test8400.cal test8500.cal test8600.cal chi.cal intfile.cal
# These files are found (but not built) in the distribution # These files are found (but not built) in the distribution
# #

View File

@@ -480,6 +480,16 @@ randrun.cal
This tests the a55 generator. This tests the a55 generator.
repeat.cal
repeat(digit_set, repeat_count)
Return the value of the digit_set repeated repeat_count times.
Both digit_set and repeat_count must be integers > 0.
For example repeat(423,5) returns the value 423423423423423,
which is the digit_set 423 repeated 5 times.
regress.cal regress.cal
@@ -815,8 +825,8 @@ 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.8 $ ## @(#) $Revision: 29.9 $
## @(#) $Id: README,v 29.8 2001/03/31 16:26:23 chongo Exp $ ## @(#) $Id: README,v 29.9 2003/01/05 08:10:56 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

53
cal/repeat.cal Normal file
View File

@@ -0,0 +1,53 @@
/*
* repeat - return the value of a repeated set of digits
*
* Copyright (C) 2003 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.3 $
* @(#) $Id: repeat.cal,v 29.3 2003/01/14 04:03:20 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/repeat.cal,v $
*
* Under source code control: 2003/01/05 00:00:01
* File existed as early as: 2003
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
/*
* repeat - return the value of a repeated set of digits
*
* usage:
* repeat(digit_set, repeat_count)
*/
define repeat(digit_set, repeat_count)
{
local digit_count; /* digits in the digit_set */
/* firewall */
if (!isint(digit_set) || digit_set <= 0) {
quit "digit set must be an integer > 0";
}
if (!isint(repeat_count) || repeat_count <= 0) {
quit "repeat count must be an integer > 0";
}
/* return repeated set of digits */
digit_count = max(digits(digit_set), 1);
return digit_set * (10^(digit_count*repeat_count)-1) / (10^digit_count-1);
}

View File

@@ -17,8 +17,8 @@
# 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.22 $ # @(#) $Revision: 29.23 $
# @(#) $Id: Makefile,v 29.22 2002/03/14 00:28:28 chongo Exp $ # @(#) $Id: Makefile,v 29.23 2003/01/14 01:58:18 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
@@ -296,9 +296,9 @@ depend:
${Q}for i in ${SCRIPT} /dev/null; do \ ${Q}for i in ${SCRIPT} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i: $$i.calc"; \ echo "$$i: $$i.calc"; \
echo ' rm -f $$@'; \ echo ' @rm -f $$@'; \
echo ' $${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \ echo ' @$${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
echo ' $${CHMOD} +x $$@'; \ echo ' @$${CHMOD} +x $$@'; \
fi; \ fi; \
done >> makedep.out done >> makedep.out
${Q}echo sample dependency list formed ${Q}echo sample dependency list formed
@@ -392,34 +392,34 @@ install: all
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.
4dsphere: 4dsphere.calc 4dsphere: 4dsphere.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
fproduct: fproduct.calc fproduct: fproduct.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
mersenne: mersenne.calc mersenne: mersenne.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
piforever: piforever.calc piforever: piforever.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
plus: plus.calc plus: plus.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
powerterm: powerterm.calc powerterm: powerterm.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
simple: simple.calc simple: simple.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@
square: square.calc square: square.calc
rm -f $@ @rm -f $@
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
${CHMOD} +x $@ @${CHMOD} +x $@

View File

@@ -18,8 +18,8 @@
# 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.19 $ # @(#) $Revision: 29.20 $
# @(#) $Id: Makefile,v 29.19 2002/03/14 00:28:28 chongo Exp $ # @(#) $Id: Makefile,v 29.20 2003/01/14 02:18:45 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
@@ -749,7 +749,6 @@ install: all
# DO NOT DELETE THIS LINE # DO NOT DELETE THIS LINE
c_argv.o: ../alloc.h c_argv.o: ../alloc.h
c_argv.o: ../block.h c_argv.o: ../block.h
c_argv.o: ../byteswap.h c_argv.o: ../byteswap.h

View File

@@ -17,8 +17,8 @@
* 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.4 $
* @(#) $Id: endian.c,v 29.3 2001/03/18 02:59:42 chongo Exp $ * @(#) $Id: endian.c,v 29.4 2003/01/14 01:50:01 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $
* *
* Under source code control: 1993/11/15 04:32:58 * Under source code control: 1993/11/15 04:32:58
@@ -36,6 +36,11 @@
#include <stdio.h> #include <stdio.h>
#include "have_stdlib.h"
#if defined(HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#include "have_unistd.h" #include "have_unistd.h"
#if defined(HAVE_UNISTD_H) #if defined(HAVE_UNISTD_H)
#include <unistd.h> #include <unistd.h>

View File

@@ -18,8 +18,8 @@
# 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.22 $ # @(#) $Revision: 29.23 $
# @(#) $Id: Makefile,v 29.22 2002/12/29 08:43:37 chongo Exp $ # @(#) $Id: Makefile,v 29.23 2003/01/14 02:24:48 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
# #
# Under source code control: 1991/07/23 06:47:57 # Under source code control: 1991/07/23 06:47:57
@@ -535,7 +535,8 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
-${Q}rm -f funclist.c -${Q}rm -f funclist.c
${Q}${SED} -n -f funclist.sed ../func.c > funclist.c ${Q}${SED} -n -f funclist.sed ../func.c > funclist.c
-${Q}rm -f funclist.o funclist -${Q}rm -f funclist.o funclist
${Q}${LCC} ${ICFLAGS} -DFUNCLIST -I/usr/include -I.. funclist.c -c ${Q}${LCC} ${ICFLAGS} -DFUNCLIST -I/usr/include \
-I.. funclist.c -c 2>/dev/null
${Q}${LCC} ${ILDFLAGS} funclist.o -o funclist ${Q}${LCC} ${ILDFLAGS} funclist.o -o funclist
-${Q}rm -f builtin -${Q}rm -f builtin
${Q}cat builtin.top > builtin ${Q}cat builtin.top > builtin

View File

@@ -13,12 +13,15 @@ TYPES
DESCRIPTION DESCRIPTION
Returns the least non-negative integer n for which abs(x) < b^n. Returns the least non-negative integer n for which abs(x) < b^n.
digits(x, b) = 0 if and only if abs(x) < 1. digits(x, b) = 0 if and only if abs(x) <= 1.
For real x with absolute value >= 1, digits(x, b) is the number For real x with absolute value > 1, digits(x, b) is the number
of digits in the standard base-b "decimal" representation of int(abs(x)); of digits in the standard base-b "decimal" representation of int(abs(x));
this is also given by 1 + ilog(x, b). this is also given by 1 + ilog(x, b).
NOTE: both digits(0) and digits(1) return the value of 1.
This is not a bug, it is a feature of the above equation. :-)
EXAMPLE EXAMPLE
> print digits(0), digits(0.0123), digits(3.7), digits(-27), digits(-99.7) > print digits(0), digits(0.0123), digits(3.7), digits(-27), digits(-99.7)
0 0 1 2 2 0 0 1 2 2
@@ -32,7 +35,7 @@ LINK LIBRARY
SEE ALSO SEE ALSO
digit, places digit, places
## Copyright (C) 1999 Landon Curt Noll ## Copyright (C) 1999-2003 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## 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 ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -48,8 +51,8 @@ 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.3 $ ## @(#) $Revision: 29.4 $
## @(#) $Id: digits,v 29.3 2000/12/14 10:32:24 chongo Exp $ ## @(#) $Id: digits,v 29.4 2003/01/14 04:09:35 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $
## ##
## Under source code control: 1995/10/03 10:40:01 ## Under source code control: 1995/10/03 10:40:01

47
no_implicit.c Normal file
View File

@@ -0,0 +1,47 @@
/*
* no-implicit - Determine if the compiler allows -Wno-implicit
*
* Copyright (C) 2003 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.1 $
* @(#) $Id: no_implicit.c,v 29.1 2003/01/14 01:45:19 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/no_implicit.c,v $
*
* Under source code control: 2003/01/14 01:45:19
* File existed as early as: 2003
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
/*
* If we are able to compile this program, then we the compiler must
* allow the -Wno-implicit flag so we output the -Wno-implicit symbol.
*/
#include <stdio.h>
int
main(void)
{
/* -Wno-implicit flag is allowed */
printf("-Wno-implicit\n");
/* exit(0); */
return 0;
}

View File

@@ -17,8 +17,8 @@
# 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.16 $ # @(#) $Revision: 29.17 $
# @(#) $Id: Makefile,v 29.16 2002/03/14 00:28:28 chongo Exp $ # @(#) $Id: Makefile,v 29.17 2003/01/14 02:00:23 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $
# #
# Under source code control: 1997/04/19 22:46:49 # Under source code control: 1997/04/19 22:46:49
@@ -571,7 +571,6 @@ install: all
# DO NOT DELETE THIS LINE # DO NOT DELETE THIS LINE
many_random.o: ../alloc.h many_random.o: ../alloc.h
many_random.o: ../block.h many_random.o: ../block.h
many_random.o: ../byteswap.h many_random.o: ../byteswap.h

9
seed.c
View File

@@ -17,8 +17,8 @@
* 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.6 $
* @(#) $Id: seed.c,v 29.5 2001/05/08 06:44:29 chongo Exp $ * @(#) $Id: seed.c,v 29.6 2003/01/14 00:51:53 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $
* *
* Under source code control: 1999/10/03 10:06:53 * Under source code control: 1999/10/03 10:06:53
@@ -41,6 +41,11 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "have_stdlib.h"
#if defined(HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#include "have_unistd.h" #include "have_unistd.h"
#if defined(HAVE_UNISTD_H) #if defined(HAVE_UNISTD_H)
#include <unistd.h> #include <unistd.h>

View File

@@ -19,8 +19,8 @@
* 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.41 $ * @(#) $Revision: 29.43 $
* @(#) $Id: version.c,v 29.41 2002/12/29 09:22:43 chongo Exp $ * @(#) $Id: version.c,v 29.43 2003/01/14 04:10:16 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $
* *
* Under source code control: 1990/05/22 11:00:58 * Under source code control: 1990/05/22 11:00:58
@@ -46,7 +46,7 @@ static char *program;
#define MAJOR_VER 2 /* major version */ #define MAJOR_VER 2 /* major version */
#define MINOR_VER 11 /* minor version */ #define MINOR_VER 11 /* minor version */
#define MAJOR_PATCH 6 /* patch level or 0 if no patch */ #define MAJOR_PATCH 6 /* patch level or 0 if no patch */
#define MINOR_PATCH 0 /* test number or 0 if no minor patch */ #define MINOR_PATCH 2 /* test number or 0 if no minor patch */
/* /*

View File

@@ -17,8 +17,8 @@
* 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.9 $ * @(#) $Revision: 29.10 $
* @(#) $Id: zmath.h,v 29.9 2002/12/29 09:20:25 chongo Exp $ * @(#) $Id: zmath.h,v 29.10 2003/01/14 00:44:39 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $
* *
* Under source code control: 1993/07/30 19:42:48 * Under source code control: 1993/07/30 19:42:48
@@ -569,6 +569,7 @@ extern DLL void math_divertio(void);
extern DLL void math_cleardiversions(void); extern DLL void math_cleardiversions(void);
extern DLL char *math_getdivertedio(void); extern DLL char *math_getdivertedio(void);
extern DLL int math_setmode(int mode); extern DLL int math_setmode(int mode);
extern DLL int math_setmode2(int mode);
extern DLL LEN math_setdigits(LEN digits); extern DLL LEN math_setdigits(LEN digits);
extern DLL void math_fmt(char *, ...); extern DLL void math_fmt(char *, ...);

View File

@@ -17,8 +17,8 @@
* 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: zrand.c,v 29.4 2001/05/08 06:44:29 chongo Exp $ * @(#) $Id: zrand.c,v 29.5 2003/01/14 00:54:24 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $
* *
* Under source code control: 1995/01/07 09:45:25 * Under source code control: 1995/01/07 09:45:25
@@ -353,6 +353,7 @@
* (used by more than one input seed). * (used by more than one input seed).
*/ */
#include <stdio.h>
#include "zrand.h" #include "zrand.h"
#include "have_const.h" #include "have_const.h"