diff --git a/CHANGES b/CHANGES index a9de506..4a61a01 100644 --- a/CHANGES +++ b/CHANGES @@ -16,7 +16,7 @@ The following are the changes from calc version 2.12.8.0 to date: calc without any compiler errors or warnings, even with -Werror -Wextra -pedantic. - To print out information about the calc compliation + To print out information about the calc compilation environment, we added the following make rule: make calcinfo @@ -30,16 +30,18 @@ The following are the changes from calc version 2.12.8.0 to date: question Email address. Created a new calc contribution Email address. See the BUGS file for details. - Added "help questions" to print the QUESIONS help file. + Added "help questions" to print the QUESTIONS help file. If the environment variable $CALCHELP is defined and is non-empty, - then calc help files will be in the direcgory by the $CALCHISTFILE + then calc help files will be in the directory by the $CALCHISTFILE environment variable. If the environment variable $CALCCUSTOMHELP is defined and is - non-empty, then custom calc help files will be in the direcgory + non-empty, then custom calc help files will be in the directory by the $CALCCUSTOMHELP environment variable. + Fixed a number of typos in text and in source code comments. + The calc-tester mailing list has been retired. See: * How to submit a calc bug report: @@ -104,7 +106,7 @@ The following are the changes from calc version 2.12.7.1 to 2.12.7.5: Copied missing description lines from help/intro to README.md "What is calc?" section. <> - GCC 7 added a warning on fall throughs in case statements. It's + GCC 7 added a warning on fall through in case statements. It's enabled by -Wextra and treated as an error due to -Wall so it breaks compilation. See -Wimplicit-fallthrough in the GCC manual. The default value is 3, which means a comment matching @@ -187,10 +189,10 @@ The following are the changes from calc version 2.12.6.9 to 2.12.6.9: Added regression tests 3729 thru 3732 to test E_TAN3, E_COT3, E_SEC3 and E_CSC3 respectively. - Added experimential %g printf (and strprintf) format implementation + Added experimental %g printf (and strprintf) format implementation based on pull request from github user 10110111. - Made exterimental changes to macOS builds to not require use of + Made experimental changes to macOS builds to not require use of /usr/include. The INCDIR for macOS uses: INCDIR= $(shell xcrun --show-sdk-path --sdk macosx)/usr/include @@ -244,7 +246,7 @@ The following are the changes from calc version 2.12.6.6 to 2.12.6.8: Fixed an error message buffer overflow thanks to a report by Frank Peters . - Replaced all use of the C funcion sprintf() with snprintf(). + Replaced all use of the C function sprintf() with snprintf(). Replaced all use of the C funcion vsprintf() with vsnprintf(). Replaced all DONT_HAVE_VSPRINTF with DONT_HAVE_VSNPRINTF. Replaced all Makefile var ${HAVE_VSPRINTF} with ${HAVE_VSNPRINTF}. @@ -380,7 +382,7 @@ The following are the changes from calc version 2.12.5.4 to 2.12.5.6: The improved gen_v1() function is capable of returning a value for all valid values of h and n. As a result, the trial tables used by gen_v1() have been changed to a short list of values - to try, in order ot likelyhood of success, before doing an + to try, in order ot likelihood of success, before doing an exhaustive search for a v1 value to return. Removed lucas_tbl.cal calc resource file. This file was made @@ -684,7 +686,7 @@ The following are the changes from calc version 2.12.4.6 to version 2.12.4.10: Silenced annoying warning about unused variable 'intp' while compiling endian.c under some circumstances. - Fixed typo in redeclaration warnings. Thanks to + Fixed typo in re-declaration warnings. Thanks to Christoph Zurnieden for this report. Added a number of calc resource files by diff --git a/HOWTO.INSTALL b/HOWTO.INSTALL index a2ef81d..6cf31c0 100644 --- a/HOWTO.INSTALL +++ b/HOWTO.INSTALL @@ -29,7 +29,7 @@ Installing calc from the bzip2-ed tarball in 4 easy steps: The top level Makefile and the custom/Makefile require a GNU Make (such as gmake) or an equivalently advanced make. On many - targets, the default make is sufficent. On FreeBSD for example, + targets, the default make is sufficient. On FreeBSD for example, one must use gmake instead of make. Some report that under macOS, one has to declare the target @@ -120,7 +120,7 @@ Installing calc from the bzip2-ed tarball in 4 easy steps: found below, comment out the Linux set and comment in that set or edit the gcc set or the common cc set as needed. - You may want to change these Makrfile variables from their defaults: + You may want to change these Makefile variables from their defaults: RANLIB @@ -152,7 +152,7 @@ Installing calc from the bzip2-ed tarball in 4 easy steps: The top level Makefile and the custom/Makefile require a GNU Make (such as gmake) or an equivalently advanced make. On many - targets, the default make is sufficent. On FreeBSD for example, + targets, the default make is sufficient. On FreeBSD for example, one must use gmake instead of make. If your target system does not have GNU Make (or equivalent), then diff --git a/Makefile b/Makefile index 5e2159f..6740137 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ # # This makefile contains only those critical rules (such as all, clean, etc.) # and the common rules needed in development (such as chk, check, etc.). -# This makefiile has a few special rules that are used to set the version +# This makefile has a few special rules that are used to set the version # string in the shipped makefiles (such as Makefile.ship). # Copyright (C) 1999-2008,2014 Landon Curt Noll @@ -53,7 +53,7 @@ # calculator by David I. Bell with help/mods from others # Makefile by Landon Curt Noll -# Try uname -s if the target was not alreadhy set on the make command line +# Try uname -s if the target was not already set on the make command line # ifeq ($(target),) target=$(shell uname -s 2>/dev/null) @@ -110,7 +110,7 @@ TOP_MAKE_FILE= Makefile EXT= #EXT=.exe -# This value is configured for chongo@theta.mellis.com. +# This value is configured for chongo for his laptop # RPM_TOP= ${HOME}/rpm/calc @@ -170,7 +170,7 @@ V=@: # XARG= -# We pass these make varaibles to the end of each make command line +# We pass these make variables to the end of each make command line # that invokes the ${MAKE_FILE}. # XVAR= \ @@ -574,7 +574,7 @@ custom/.all: ### # -# building calc-static and static lib*.a libraires +# building calc-static and static lib*.a libraries # ### @@ -603,7 +603,7 @@ libcustcalc.a: # Home grown make dependency rules. Your system make not support # or have the needed tools. You can ignore this section. # -# We will form a skelaton tree of *.c files containing only #include "foo.h" +# We will form a skeleton tree of *.c files containing only #include "foo.h" # lines and .h files containing the same lines surrounded by multiple include # prevention lines. This allows us to build a static depend list that will # satisfy all possible cpp symbol definition combinations. @@ -712,7 +712,7 @@ chk: # debug # # make calcinfo: -# * print information about the host ane compile environment +# * print information about the host and compile environment # # make env: # * print major Makefile variables @@ -836,7 +836,7 @@ inst_files: ${Q} ${MAKE} ${XARG} -f ${MAKE_FILE} $@ ${XVAR} ${V} echo '=-=-=-=-= private Makefile $@ rule end =-=-=-=-=' -# The olduninstall rule will remove calc files from the older, histroic +# The olduninstall rule will remove calc files from the older, historic # locations under the /usr/local directory. If you are using the # new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR} # then you can use this rule to clean out the older calc stuff under @@ -894,7 +894,7 @@ strip: ${Q} ${MAKE} ${XARG} -f ${MAKE_FILE} $@ ${XVAR} ${V} echo '=-=-=-=-= private Makefile $@ rule end =-=-=-=-=' -# calc-symlink - setup symlinks from stardard locations into the ${T} tree +# calc-symlink - setup symlinks from standard locations into the ${T} tree # calc-symlink: ${V} echo '=-=-=-=-= private Makefile $@ rule start =-=-=-=-=' diff --git a/Makefile.ship b/Makefile.ship index 6ffd6b4..5065f7f 100644 --- a/Makefile.ship +++ b/Makefile.ship @@ -1123,7 +1123,7 @@ EXTRA_LDFLAGS= # Architecture compile flags # # The ARCH_CFLAGS are ${CC} when compiling C files. They follow -# CCMISC and preceed EXTRA_CFLAGS. +# CCMISC and precede EXTRA_CFLAGS. # ARCH_CFLAGS= -march=native #ARCH_CFLAGS= @@ -2088,7 +2088,7 @@ LICENSE= COPYING COPYING-LGPL # DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README.FIRST \ README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \ - sample.README calc.spec.in rpm.mk README.md QUESTION CONTRUB + sample.README calc.spec.in rpm.mk README.md QUESTION CONTRIB-CODE # These files are used to make (but not build) a calc .a link library # @@ -2199,7 +2199,7 @@ check_include: echo "Without critical include files, we cannot compile." 1>&2; \ echo "Perhaps your system isn't setup to compile C source?" 1>&2; \ echo 1>&2; \ - echo "For example, Apple macOS / Darwin requres that XCode" 1>&2; \ + echo "For example, Apple macOS / Darwin requires that XCode" 1>&2; \ echo "must be installed." 1>&2; \ echo 1>&2; \ echo "Also macOS users might later to run this command:" 1>&2; \ @@ -4039,7 +4039,7 @@ chk: ./cal/regress.cal # debug # # make calcinfo: -# * print information about the host ane compile environment +# * print information about the host and compile environment # # make env: # * print major Makefile variables diff --git a/README.md b/README.md index 5df2051..2fa5350 100644 --- a/README.md +++ b/README.md @@ -260,4 +260,4 @@ help unexpected ``` It contains information about differences between C and calc -that may surprize C programmers. +that may surprise C programmers. diff --git a/blkcpy.c b/blkcpy.c index b3401f2..f73b86f 100644 --- a/blkcpy.c +++ b/blkcpy.c @@ -1040,7 +1040,7 @@ copyblk2num(BLOCK *sblk, long ssi, long num, NUMBER *dnum, long dsi, NUMBER *ret; /* cloned and modified numerator */ #if CALC_BYTE_ORDER == BIG_ENDIAN HALF *swapped; /* byte swapped input data */ - unsigned long halflen; /* length of the input ounded up to HALFs */ + unsigned long halflen; /* length of the input rounded up to HALFs */ HALF *h; /* copy byteswap pointer */ unsigned long i; #endif diff --git a/block.c b/block.c index 4fa8859..4e2e9f7 100644 --- a/block.c +++ b/block.c @@ -291,7 +291,7 @@ blkrealloc(BLOCK *blk, int newlen, int newchunk) * Set the data length * * We also know that the new block is not empty since we have - * already dealth with that case above. + * already dealt with that case above. * * After this section of code, limit and datalen will be * correct in terms of the new type. diff --git a/block.h b/block.h index 8964de7..1b14851 100644 --- a/block.h +++ b/block.h @@ -55,7 +55,7 @@ * blkchunk defaults to BLK_CHUNKSIZE * * blkfree(x) - * Reduce storage down to 0 octetes. + * Reduce storage down to 0 octets. * * size(x) * The length of data stored in the block. @@ -88,7 +88,7 @@ * blkmove(dest, src, length [, dest_offset [, src_offset]]) * 0 <= length <= blksize(x) * offset's are restricted in value by block type - * overlapping moves are handeled correctly + * overlapping moves are handled correctly * * blkccpy(dest, src, stopval, length [, dest_offset [, src_offset]]) * 0 <= length <= blksize(x) @@ -104,7 +104,7 @@ * b = a*k for some integer k >= 1 * * scatter(src, dest1, dest2 [, dest3 ] ...) - * copy sucessive octets from src into dest1, dest2, ... + * copy successive octets from src into dest1, dest2, ... * restarting with dest1 after end of list * stops at end of src * @@ -184,7 +184,7 @@ EXTERN int blk_debug; /* 0 => debug off */ /* length of data stored in a block */ #define blklen(blk) ((blk)->datalen) -/* block footpint in memory */ +/* block footprint in memory */ #define blksizeof(blk) ((blk)->maxsize) /* block allocation chunk size */ diff --git a/byteswap.c b/byteswap.c index c50e75f..f4c75a7 100644 --- a/byteswap.c +++ b/byteswap.c @@ -77,7 +77,7 @@ swap_b8_in_HALFs(HALF *dest, HALF *src, LEN len) * NULL to allocate the storage * src - pointer to a ZVALUE to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -145,7 +145,7 @@ swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all) * NULL to allocate the storage * src - pointer to a NUMBER to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -209,7 +209,7 @@ swap_b8_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all) * NULL to allocate the storage * src - pointer to a COMPLEX to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -313,7 +313,7 @@ swap_b16_in_HALFs(HALF *dest, HALF *src, LEN len) * NULL to allocate the storage * src - pointer to a ZVALUE to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -380,7 +380,7 @@ swap_b16_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all) * NULL to allocate the storage * src - pointer to a NUMBER to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -444,7 +444,7 @@ swap_b16_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all) * NULL to allocate the storage * src - pointer to a COMPLEX to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -508,7 +508,7 @@ swap_b16_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all) * NULL to allocate the storage * src - pointer to a ZVALUE to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -576,7 +576,7 @@ swap_HALF_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all) * NULL to allocate the storage * src - pointer to a NUMBER to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put @@ -640,7 +640,7 @@ swap_HALF_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all) * NULL to allocate the storage * src - pointer to a COMPLEX to swap * all - TRUE => swap every element, FALSE => swap only the - * multiprecision storage + * multi-precision storage * * returns: * pointer to where the swapped src has been put diff --git a/cal/Makefile b/cal/Makefile index 816d8ec..3862d14 100644 --- a/cal/Makefile +++ b/cal/Makefile @@ -181,14 +181,14 @@ FMT= fmt # The calc files to install # -# This list is prodiced by the detaillist rule when no WARNINGS are detected. +# This list is produced by the detaillist rule when no WARNINGS are detected. # # Please use: # # make calc_files_list # # to keep this list in nice sorted order and to check that these -# deailed help files are under RCS control. +# detailed help files are under RCS control. # CALC_FILES= README alg_config.cal beer.cal bernoulli.cal \ bernpoly.cal bigprime.cal bindings brentsolve.cal chi.cal chrem.cal \ @@ -236,7 +236,7 @@ all: ${CALC_FILES} ${MAKE_FILE} .all # sub-directory called calc/cal. # # NOTE: Due to bogus shells found on one common system we must have -# an non-emoty else clause for every if condition. *sigh* +# an non-empty else clause for every if condition. *sigh* # ## @@ -391,7 +391,7 @@ uninstall: if [ -f "${T}${CALC_SHAREDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CALC_SHAREDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CALC_SHAREDIR}/$$i"; \ + echo "un-installed ${T}${CALC_SHAREDIR}/$$i"; \ fi; \ fi; \ done diff --git a/cal/README b/cal/README index 810bc7c..a359ce1 100644 --- a/cal/README +++ b/cal/README @@ -213,12 +213,12 @@ brentsolve.cal brentsolve(low, high,eps) - A root-finder implementwed with the Brent-Dekker trick. + A root-finder implemented with the Brent-Dekker trick. brentsolve2(low, high,which,eps) The second function, brentsolve2(low, high,which,eps) has some lines - added to make it easier to hardcode the name of the helper function + added to make it easier to hard-code the name of the helper function different from the obligatory "f". See: @@ -392,7 +392,7 @@ factorial2.cal bigcatalan(n) - Calculates the n-th Catalan number for n large. It is usefull + Calculates the n-th Catalan number for n large. It is useful above n~50,000 but defaults to the builtin function for smaller values.Meant as a complete replacement for catalan(n) with only a very small overhead. See: @@ -433,9 +433,9 @@ factorial2.cal k = 0 The other function stirling2caching(n,m) does it by way of the - reccurence relation and keeps all earlier results. This function + re-occurrence relation and keeps all earlier results. This function is much slower for computing a single value than stirling2(n,m) but - is very usefull if many Stirling numbers are needed, for example in + is very useful if many Stirling numbers are needed, for example in a series. See: http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind @@ -546,7 +546,7 @@ infinities.cal pinf() The symbolic handling of infinities. Needed for intnum.cal but might be - usefull elsewhere, too. + useful elsewhere, too. intfile.cal @@ -595,13 +595,13 @@ intnum.cal This file offers some methods for numerical integration. Implemented are the Gauss-Legendre and the tanh-sinh quadrature. - All functions are usefull to some extend but the main function for + All functions are useful to some extend but the main function for quadrature is quad(), which is not much more than an abstraction layer. - The main workers are quadgl() for Gauss-legendre and quadts() for the + The main workers are quadgl() for Gauss-Legendre and quadts() for the tanh-sinh quadrature. The limits of the integral can be anything in the complex plane and the extended real line. The latter means that infinite - limits are supported by way of the smbolic infinities implemented in the + limits are supported by way of the symbolic infinities implemented in the file infinities.cal (automatically linked in by intnum.cal). Integration in parts and contour is supported by the "points" argument @@ -661,7 +661,7 @@ intnum.cal The quad*core functions do not offer anything fancy but the third parameter controls the so called "order" which is just the number of nodes computed. - This can be quite usefull in some circumstances. + This can be quite useful in some circumstances. ; quadgldeletenodes() ; define f(x){ return exp(x);} @@ -723,7 +723,7 @@ lambertw.cal ProductLog[branch,z] with the tested values. The series is only valid for the branches 0,-1, real z, converges - for values of z _very_ near the branchpoint -exp(-1) only, and must + for values of z _very_ near the branch-point -exp(-1) only, and must be given the branches explicitly. See the code in lambertw.cal for further information. @@ -746,7 +746,7 @@ lnseries.cal does so by computing the prime factorization of all of the number sequence 1,2,3...n, calculates the natural logarithms of the primes in 1,2,3...n and uses the above factorization to build the natural - logarithms of the rest of the sequence by sadding the logarithms of + logarithms of the rest of the sequence by adding the logarithms of the primes in the factorization. This is faster for high precision of the logarithms and/or long sequences. @@ -806,7 +806,7 @@ mfactor.cal at 2*start_k*n+1. Skips values that are multiples of primes <= p_elim. By default, start_k == 1, rept_loop = 10000 and p_elim = 17. - The p_elim == 17 overhead takes ~3 minutes on an 200 Mhz r4k CPU and + The p_elim == 17 overhead takes ~3 minutes on an 200 MHz r4k CPU and requires about ~13 Megs of memory. The p_elim == 13 overhead takes about 3 seconds and requires ~1.5 Megs of memory. @@ -1317,7 +1317,7 @@ specialfunctions.cal http://en.wikipedia.org/wiki/Polygamma http://dlmf.nist.gov/5 - for information on the n-th derivative ofthe Euler gamma function. This + for information on the n-th derivative of the Euler gamma function. This function depends on the script zeta2.cal. @@ -1334,7 +1334,7 @@ specialfunctions.cal zeta(s) - Calculates the value of the Rieman Zeta function at s. See: + Calculates the value of the Riemann Zeta function at s. See: http://en.wikipedia.org/wiki/Riemann_zeta_function http://dlmf.nist.gov/25.2 @@ -1353,7 +1353,7 @@ statistics.cal invbetainc(x,a,b) Computes the inverse of the regularized beta function. Does so the - brute-force way wich makes it a bit slower. + brute-force way which makes it a bit slower. betapdf(x,a,b) betacdf(x,a,b) @@ -1433,7 +1433,7 @@ sumtimes.cal Give the user CPU time for various ways of evaluating sums, sums of squares, etc, for large lists and matrices. N is the size of the list or matrix to use. The doalltimes() function will run - all fo the sumtimes tests. For example: + all of the sumtimes tests. For example: doalltimes(1e6); diff --git a/cal/alg_config.cal b/cal/alg_config.cal index bb6a452..6f13f82 100644 --- a/cal/alg_config.cal +++ b/cal/alg_config.cal @@ -33,7 +33,7 @@ static test_time; /* try for this many seconds in loop test */ * given: * ratio the ratio of time between two algorithms * - * retuns: + * returns: * 1 When ratio is near 1.0 * 0 otherwise * @@ -354,7 +354,7 @@ define best_mul2() local high; /* high loop value tested */ local mid; /* between low and high */ local best_val; /* value found with ratio closest to unity */ - local best_ratio; /* cloest ratio found to unity */ + local best_ratio; /* closest ratio found to unity */ local expand; /* how fast to expand the length */ /* @@ -363,7 +363,7 @@ define best_mul2() printf("WARNING: This tool may not be computing the correct best value\n"); test_time = 5.0; printf("The best_mul2() function will take a LONG time to run!\n"); - printf("It is important that best_mul2() run on an othwewise idle host!\n"); + printf("It is important that best_mul2() run on an otherwise idle host!\n"); if (config("user_debug") <= 0) { printf("To monitor progress, set user_debug to 2: " "config(\"user_debug\", 2)\n"); @@ -392,7 +392,7 @@ define best_mul2() */ do { /* - * determine the paramters of the next ratio test + * determine the parameters of the next ratio test * * We will multiplicatively expand our test level until * the ratio drops below 1.0. @@ -419,7 +419,7 @@ define best_mul2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -442,7 +442,7 @@ define best_mul2() high /= 2; low = high / 2; if (config("user_debug") > 0) { - printf("retesting multiply alg1/alg2 ratio for len = %d\n", + printf("re-testing multiply alg1/alg2 ratio for len = %d\n", high); } ratio = mul_ratio(high); @@ -450,7 +450,8 @@ define best_mul2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio " + "to unity: %.6f\n", best_val, best_ratio); } } @@ -483,7 +484,7 @@ define best_mul2() best_val = mid; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -535,7 +536,7 @@ define best_mul2() printf("config(\"mul2\", %d),;\n", best_val); printf("WARNING: It is believed that the output " "of this resource file is bogus!\n"); - printf("WARNING: You may NOT wish to follow the above suggeston.\n"); + printf("WARNING: You may NOT wish to follow the above suggestion.\n"); } return mid; } @@ -835,7 +836,7 @@ define best_sq2() local high; /* high loop value tested */ local mid; /* between low and high */ local best_val; /* value found with ratio closest to unity */ - local best_ratio; /* cloest ratio found to unity */ + local best_ratio; /* closest ratio found to unity */ local expand; /* how fast to expand the length */ /* @@ -844,7 +845,7 @@ define best_sq2() printf("WARNING: This tool may not be computing the correct best value\n"); test_time = 5.0; printf("The best_sq2() function will take a LONG time to run!\n"); - printf("It is important that best_sq2() run on an othwewise idle host!\n"); + printf("It is important that best_sq2() run on an otherwise idle host!\n"); if (config("user_debug") <= 0) { printf("To monitor progress, set user_debug to 2: " "config(\"user_debug\", 2)\n"); @@ -873,7 +874,7 @@ define best_sq2() */ do { /* - * determine the paramters of the next ratio test + * determine the parameters of the next ratio test * * We will multiplicatively expand our test level until * the ratio drops below 1.0. @@ -900,7 +901,7 @@ define best_sq2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -923,7 +924,7 @@ define best_sq2() high /= 2; low = high / 2; if (config("user_debug") > 0) { - printf("retesting multiply alg1/alg2 ratio for len = %d\n", + printf("re-testing multiply alg1/alg2 ratio for len = %d\n", high); } ratio = mul_ratio(high); @@ -931,7 +932,8 @@ define best_sq2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio " + "to unity: %.6f\n", best_val, best_ratio); } } @@ -964,7 +966,7 @@ define best_sq2() best_val = mid; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -1017,7 +1019,7 @@ define best_sq2() printf("config(\"sq2\", %d),;\n", best_val); printf("WARNING: It is believed that the output " "of this resource file is bogus!\n"); - printf("WARNING: You may NOT wish to follow the above suggeston.\n"); + printf("WARNING: You may NOT wish to follow the above suggestion.\n"); } return mid; } @@ -1337,7 +1339,7 @@ define best_pow2() local high; /* high loop value tested */ local mid; /* between low and high */ local best_val; /* value found with ratio closest to unity */ - local best_ratio; /* cloest ratio found to unity */ + local best_ratio; /* closest ratio found to unity */ local expand; /* how fast to expand the length */ local looped; /* 1 ==> we have expanded lengths before */ @@ -1347,7 +1349,7 @@ define best_pow2() printf("WARNING: This tool may not be computing the correct best value\n"); test_time = 60.0; printf("The best_pow2() function will take a LONG time to run!\n"); - printf("It is important that best_pow2() run on an othwewise idle host!\n"); + printf("It is important that best_pow2() run on an otherwise idle host!\n"); if (config("user_debug") <= 0) { printf("To monitor progress, set user_debug to 2: " "config(\"user_debug\", 2)\n"); @@ -1358,7 +1360,7 @@ define best_pow2() * firewall - must have a >1.02 ratio for the initial length * * We select 1.02 because of the precision of the CPU timing. We - * want to firt move into an area where the 1st algoritm clearly + * want to first move into an area where the 1st algorithm clearly * dominates. */ low = 4; @@ -1375,7 +1377,7 @@ define best_pow2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -1397,7 +1399,7 @@ define best_pow2() looped = 0; do { /* - * determine the paramters of the next ratio test + * determine the parameters of the next ratio test * * We will multiplicatively expand our test level until * the ratio drops below 1.0. @@ -1435,7 +1437,7 @@ define best_pow2() best_val = high; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -1463,7 +1465,7 @@ define best_pow2() best_val = mid; best_ratio = ratio; if (config("user_debug") > 1) { - printf(" len %d has a new cloest ratio to unity: %.6f\n", + printf(" len %d has a new closest ratio to unity: %.6f\n", best_val, best_ratio); } } @@ -1516,7 +1518,7 @@ define best_pow2() printf("config(\"pow2\", %d),;\n", best_val); printf("WARNING: It is believed that the output " "of this resource file is bogus!\n"); - printf("WARNING: You may NOT wish to follow the above suggeston.\n"); + printf("WARNING: You may NOT wish to follow the above suggestion.\n"); } return mid; } diff --git a/cal/bernoulli.cal b/cal/bernoulli.cal index 6c11979..0f1ce98 100644 --- a/cal/bernoulli.cal +++ b/cal/bernoulli.cal @@ -1,5 +1,5 @@ /* - * bernoulli - clculate the Nth Bernoulli number B(n) + * bernoulli - calculate the Nth Bernoulli number B(n) * * Copyright (C) 2000 David I. Bell and Landon Curt Noll * @@ -26,9 +26,9 @@ /* * Calculate the Nth Bernoulli number B(n). * - * NOTE: This is now a bulitin function. + * NOTE: This is now a builtin function. * - * The non-buildin code used the following symbolic formula to calculate B(n): + * The non-builtin code used the following symbolic formula to calculate B(n): * * (b+1)^(n+1) - b^(n+1) = 0 * @@ -42,7 +42,7 @@ * B(3) = -(6*B(2) + 4*B(1) + 1) / 4 * * The combinatorial factors in the expansion of the above formula are - * calculated interatively, and we use the fact that B(2i+1) = 0 if i > 0. + * calculated interactively, and we use the fact that B(2i+1) = 0 if i > 0. * Since all previous B(n)'s are needed to calculate a particular B(n), all * values obtained are saved in an array for ease in repeated calculations. */ diff --git a/cal/bernpoly.cal b/cal/bernpoly.cal index e1a2048..2d23534 100644 --- a/cal/bernpoly.cal +++ b/cal/bernpoly.cal @@ -1,5 +1,5 @@ /* - * bernpoly - Bernoully polynomials B_n(z) for arbitrary n,z.. + * bernpoly - Bernoulli polynomials B_n(z) for arbitrary n,z.. * * Copyright (C) 2013 Christoph Zurnieden * diff --git a/cal/brentsolve.cal b/cal/brentsolve.cal index c43ef9e..146a79f 100644 --- a/cal/brentsolve.cal +++ b/cal/brentsolve.cal @@ -143,7 +143,7 @@ define brentsolve2(low, high,which,eps){ switch(param(0)){ case 0: - case 1: return newerror("brentsolve2: not enough argments"); + case 1: return newerror("brentsolve2: not enough arguments"); case 2: eps = epsilon(epsilon()*1e-2); which = 0;break; case 3: eps = epsilon(epsilon()*1e-2);break; diff --git a/cal/chi.cal b/cal/chi.cal index 604b47a..602ec76 100644 --- a/cal/chi.cal +++ b/cal/chi.cal @@ -51,7 +51,7 @@ define Z(x, eps_term) /* - * P(x[, eps]) asymtotic P(x) expansion for x>0 to an given epsilon error term + * P(x[, eps]) asymptotic P(x) expansion for x>0 to an given epsilon error term * * NOTE: If eps is omitted, the stored epsilon value is used. * @@ -99,7 +99,7 @@ define P(x, eps_term) } /* - * aproximate sum(n=0; n < infinity){x^(2*n+1)/(1*3*5*...(2*n+1)} + * approximate sum(n=0; n < infinity){x^(2*n+1)/(1*3*5*...(2*n+1)} */ x2 = x*x; x_term = x; @@ -130,7 +130,7 @@ define P(x, eps_term) * * The chi_prob() function does not work well with odd degrees of freedom. * It is reasonable with even degrees of freedom, although one must give - * a sifficently small error term as the degress gets large (>100). + * a sufficiently small error term as the degrees gets large (>100). * * NOTE: This function does not work well with odd degrees of freedom. * Can somebody help / find a bug / provide a better method of @@ -186,7 +186,7 @@ define chi_prob(chi_sq, v, eps_term) local r; /* index in finite sum */ local r_lim; /* limit value for r */ local s; /* sum */ - local d; /* demoninator (2*4*6*... or 1*3*5...) */ + local d; /* denominator (2*4*6*... or 1*3*5...) */ local chi_term; /* chi_sq^r */ local ret; /* return value */ diff --git a/cal/chrem.cal b/cal/chrem.cal index 5b151a2..280b7c2 100644 --- a/cal/chrem.cal +++ b/cal/chrem.cal @@ -1,5 +1,5 @@ /* - * chrem - chinese remainder theorem/problem solver + * chrem - Chinese remainder theorem/problem solver * * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll * @@ -26,7 +26,7 @@ */ /* - * When possible, chrem finds solutions for x of a set of congruences + * When possible, chrem finds solutions for x of a set of congruence * of the form: * * x = r1 (mod m1) @@ -35,7 +35,7 @@ * * where the residues r1, r2, ... and the moduli m1, m2, ... are * given integers. The Chinese remainder theorem states that if - * m1, m2, ... are relatively prime in pairs, the above congruences + * m1, m2, ... are relatively prime in pairs, the above congruence * have a unique solution modulo m1 * m2 * ... If m1, m2, ... * are not relatively prime in pairs, it is possible that no solution * exists. If solutions exist, the general solution is expressible as: diff --git a/cal/dms.cal b/cal/dms.cal index e5c74ca..9a35610 100644 --- a/cal/dms.cal +++ b/cal/dms.cal @@ -53,7 +53,7 @@ define dms_add(a, b) { local obj dms ans; /* return value */ - /* initalize value to 1st arg */ + /* initialize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is dms object, load it */ ans.deg = a.deg; @@ -110,7 +110,7 @@ define dms_sub(a, b) { local obj dms ans; /* return value */ - /* initalize value to 1st arg */ + /* initialize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is dms object, load it */ ans.deg = a.deg; @@ -352,11 +352,11 @@ define fixdms(a) quit "attempt to fix a non dms object"; } - /* force minutes to be intergral */ + /* force minutes to be integral */ a.min += frac(a.deg) * 60; a.deg = int(a.deg); - /* force degrees to be intergral */ + /* force degrees to be integral */ a.sec += frac(a.min) * 60; a.min = int(a.min); diff --git a/cal/dotest.cal b/cal/dotest.cal index 8a7e48c..04f9e93 100644 --- a/cal/dotest.cal +++ b/cal/dotest.cal @@ -8,8 +8,8 @@ * copyright this dotest_code. * * ERNEST BOWEN AND LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER- - * CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER- + * CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT * NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, @@ -173,7 +173,7 @@ define dotest(dotest_file, dotest_code = 0, dotest_maxcond = -1) } /* - * preppare to return to the caller environment + * prepare to return to the caller environment * * We increase the caller's error count by the number * of line tests that failed, not the number of internal diff --git a/cal/factorial2.cal b/cal/factorial2.cal index ded4773..c74473f 100644 --- a/cal/factorial2.cal +++ b/cal/factorial2.cal @@ -281,10 +281,10 @@ define __CZ__multiply_factored_factorial(matrix,stop){ } /* - Compute binomial coeficients n!/(k!(n-k)!) + Compute binomial coefficients n!/(k!(n-k)!) One of the rare cases where a formula once meant to ease manual computation - is actually the (aymptotically) fastest way to do it (in July 2013) for + is actually the (asymptotically) fastest way to do it (in July 2013) for the extreme case binomial(2N,N) but for a high price, the memory needed is pi(N)--theoretically. */ @@ -626,7 +626,7 @@ define subfactorialrecursive(n){ return n * subfactorialrecursive(n-1) + (-1)^n; } -/* This is, quite amusingely, faster than the very same algorithm in +/* This is, quite amusingly, faster than the very same algorithm in PARI/GP + GMP*/ define subfactorialiterative(n){ local k temp1 temp2 ret; diff --git a/cal/hms.cal b/cal/hms.cal index 5fa826c..33255b7 100644 --- a/cal/hms.cal +++ b/cal/hms.cal @@ -53,7 +53,7 @@ define hms_add(a, b) { local obj hms ans; /* return value */ - /* initalize value to 1st arg */ + /* initialize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is hms object, load it */ ans.hour = a.hour; @@ -110,7 +110,7 @@ define hms_sub(a, b) { local obj hms ans; /* return value */ - /* initalize value to 1st arg */ + /* initialize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is hms object, load it */ ans.hour = a.hour; @@ -352,11 +352,11 @@ define fixhms(a) quit "attempt to fix a non hms object"; } - /* force minutes to be intergral */ + /* force minutes to be integral */ a.min += frac(a.hour) * 60; a.hour = int(a.hour); - /* force hours to be intergral */ + /* force hours to be integral */ a.sec += frac(a.min) * 60; a.min = int(a.min); diff --git a/cal/intfile.cal b/cal/intfile.cal index e70961a..e30b420 100644 --- a/cal/intfile.cal +++ b/cal/intfile.cal @@ -27,20 +27,20 @@ /* * NOTE: Because leading HALF values are trimmed from integer, a file - * that begins with lots of 0 bits (in the case of big endian) - * or that ends with lots of 0 bits (in the case of little endian) + * that begins with lots of 0 bits (in the case of big Endian) + * or that ends with lots of 0 bits (in the case of little Endian) * will be changed when the subsequent integer is written back. */ /* - * file2be - convert a file into an big endian integer + * file2be - convert a file into an big Endian integer * * given: * filename filename to read * * returns: - * integer read from its contents on big endian order + * integer read from its contents on big Endian order */ define file2be(filename) { @@ -75,13 +75,13 @@ define file2be(filename) /* - * file2le - convert a file into an little endian integer + * file2le - convert a file into an little Endian integer * * given: * filename filename to read * * returns: - * integer read from its contents on little endian order + * integer read from its contents on little Endian order */ define file2le(filename) { @@ -118,7 +118,7 @@ define file2le(filename) /* - * be2file - convert a big endian integer into a file + * be2file - convert a big Endian integer into a file * * given: * v integer to write to the file @@ -168,7 +168,7 @@ define be2file(v, filename) /* - * le2file - convert a little endian integer into a file + * le2file - convert a little Endian integer into a file * * given: * v integer to write to the file diff --git a/cal/intnum.cal b/cal/intnum.cal index 9960ecb..5796de7 100644 --- a/cal/intnum.cal +++ b/cal/intnum.cal @@ -295,7 +295,7 @@ define quadts(a, b, points) * as the number of equally spaced intervals on a straight line * connecting a and b. Computing the segments here is a bit * more complicated but not much, it should have been taught in - * highschool. + * high school. * Other contours by way of a list of points */ slope = (im(b) - im(a)) / (re(b) - re(a)); C = (im(a) + slope) * re(a); diff --git a/cal/lambertw.cal b/cal/lambertw.cal index 154e524..49a1c7b 100644 --- a/cal/lambertw.cal +++ b/cal/lambertw.cal @@ -83,7 +83,7 @@ define __CZ__lambertw_m1(z,eps){ or by using the function lambertw_series_print() after running lambertw_series(z,eps,branch,terms) at least once with the wanted number of terms and z = 1 (which might throw an error because the series will not - converge in anybodies lifetime for something that far from the branchpoint). + converge in anybodies lifetime for something that far from the branch point). */ @@ -105,7 +105,7 @@ define lambertw_series_print(){ } /* - The series is fast but only if _very_ close to the branchpoint + The series is fast but only if _very_ close to the branch point The exact branch must be given explicitly, e.g.: ; lambertw(-exp(-1)+.001)-lambertw_series(-exp(-1)+.001,epsilon()*1e-10,0) diff --git a/cal/linear.cal b/cal/linear.cal index e8629f5..8b7ae07 100644 --- a/cal/linear.cal +++ b/cal/linear.cal @@ -29,7 +29,7 @@ * * given: * x0, y0 first known point on the line - * x1, y1 second knonw point on the line + * x1, y1 second known point on the line * x a given point to interpolate on * * returns: diff --git a/cal/lucas.cal b/cal/lucas.cal index 7d20bd4..7bf3aa4 100644 --- a/cal/lucas.cal +++ b/cal/lucas.cal @@ -947,7 +947,7 @@ rodseth_xhn(x, h, n) * * Without Jacobi symbol value caching, it requires on average * 4.851377 Jacobi symbol evaluations. With Jacobi symbol value caching - * cacheing, an averare of 4.348820 Jacobi symbol evaluations is needed. + * cacheing, an average of 4.348820 Jacobi symbol evaluations is needed. * * Given this information, when odd h is a multiple of 3 we try, in order, * these odd values of X: @@ -961,7 +961,7 @@ rodseth_xhn(x, h, n) * jacobi(X-2, h*2^n-1) == 1 * jacobi(X+2, h*2^n-1) == -1 * - * Less than 1 case out of 1000000 will not be satisifed by the above list. + * Less than 1 case out of 1000000 will not be satisfied by the above list. * If no value in that list works, we start simple search starting with X = 167 * and incrementing by 2 until a value of X is found. * @@ -1049,7 +1049,7 @@ next_x = 167; /* must be 2 more than the largest value in x_tbl[] */ * else * v(1) = 4 * - * HOTE: The above "if then else" works only of h is not a multiple of 3. + * NOTE: The above "if then else" works only of h is not a multiple of 3. * *** * @@ -1234,10 +1234,10 @@ gen_v1(h, n) * jacobi(X-2, h*2^n-1) == 1 part 1 * jacobi(X+2, h*2^n-1) == -1 part 2 * - * NOTE: If we wanted to be super optimial, we would cache + * NOTE: If we wanted to be super optimal, we would cache * jacobi(X+2, h*2^n-1) that that when we increment X * to the next odd value, the now jacobi(X-2, h*2^n-1) - * does not need to be re-evaluted. + * does not need to be re-evaluated. */ testval = h*2^n-1; for (i=0; i < x_tbl_len; ++i) { @@ -1285,7 +1285,7 @@ gen_v1(h, n) /* * We are in that rare case (less than 1 in 1 000 000) where none of the * common X values satisfy Ref4 condition 1. We start a linear search - * of odd vules at next_x from here on. + * of odd values at next_x from here on. */ x = next_x; while (rodseth_xhn(x, h, n) != 1) { diff --git a/cal/lucas_chk.cal b/cal/lucas_chk.cal index 323eba1..4c39614 100644 --- a/cal/lucas_chk.cal +++ b/cal/lucas_chk.cal @@ -303,7 +303,7 @@ read -once "lucas.cal"; * [quiet] if given and != 0, then do not print individual test results * * returns: - * 1 all is ok + * 1 all is OK * 0 something went wrong */ define diff --git a/cal/mfactor.cal b/cal/mfactor.cal index b7b20fe..007a9b8 100644 --- a/cal/mfactor.cal +++ b/cal/mfactor.cal @@ -79,7 +79,7 @@ * hindx = 0; * } while (test_factor < some_limit); * - * The test, mfactor(67, 1, 10000) took on an 200 Mhz r4k (user CPU seconds): + * The test, mfactor(67, 1, 10000) took on an 200 MHz r4k (user CPU seconds): * * 210.83 (prior to use of hset[]) * 78.35 (hset[] for p_elim = 7) @@ -99,7 +99,7 @@ * 57.78 (hset[] for p_elim = 17) * p_elim == 19 rejected because of memory size * - * The p_elim == 17 overhead takes ~3 minutes on an 200 Mhz r4k CPU and + * The p_elim == 17 overhead takes ~3 minutes on an 200 MHz r4k CPU and * requires about ~13 Megs of memory. The p_elim == 13 overhead * takes about 3 seconds and requires ~1.5 Megs of memory. * @@ -256,7 +256,7 @@ define mfactor(n, start_k, rept_loop, p_elim) return q; } else { /* report this loop */ - printf("at 2*%d*%d+1, cpu: %f\n", + printf("at 2*%d*%d+1, CPU: %f\n", (q-1)/(2*n), n, usertime()); fflush(files(1)); loop = 0; @@ -269,14 +269,14 @@ define mfactor(n, start_k, rept_loop, p_elim) */ if (rept_loop <= ++loop) { /* report this loop */ - printf("at 2*%d*%d+1, cpu: %f\n", + printf("at 2*%d*%d+1, CPU: %f\n", (q-1)/(2*n), n, usertime()); fflush(files(1)); loop = 0; } /* - * skip if divisable by a prime <= 449 + * skip if divisible by a prime <= 449 * * The value 281 was determined by timing loops * which found that 281 was at or near the @@ -285,7 +285,7 @@ define mfactor(n, start_k, rept_loop, p_elim) * The addition of the do { ... } while (factor(q, 449)>1); * loop reduced the factoring loop time (36504 k values with * the hset[] initialization time removed) from 25.69 sec to - * 15.62 sec of CPU time on a 200Mhz r4k. + * 15.62 sec of CPU time on a 200MHz r4k. */ do { /* diff --git a/cal/natnumset.cal b/cal/natnumset.cal index 82fc12f..48d66ef 100644 --- a/cal/natnumset.cal +++ b/cal/natnumset.cal @@ -76,7 +76,7 @@ * A \ B = set difference, integers in A but not in B * * ~A = complement of A, integers not in A - * #A = number ofintegers in A + * #A = number of integers in A * !A = 1 or 0 according as A is empty or not empty * +A = sum of the members of A * @@ -100,7 +100,7 @@ * A >= B = (B <= A) * A > B = (B < A) * - * Expresssions may be formed from the above "arithmetic" operations in + * Expressions may be formed from the above "arithmetic" operations in * the usual way, with parentheses for variations from the usual precedence * rules. For example * diff --git a/cal/pell.cal b/cal/pell.cal index ec6aafe..a09b4de 100644 --- a/cal/pell.cal +++ b/cal/pell.cal @@ -25,7 +25,7 @@ /* * Solve Pell's equation; Returns the solution X to: X^2 - D * Y^2 = 1. - * Type the solution to pells equation for a particular D. + * Type the solution to Pell's equation for a particular D. */ diff --git a/cal/poly.cal b/cal/poly.cal index 61676df..1048026 100644 --- a/cal/poly.cal +++ b/cal/poly.cal @@ -35,7 +35,7 @@ * variable has only one name. For some purposes, a name like * "sin(t)" or "(a + b)" or "\lambda" might be useful; * names like "*" or "-27" are legal but might give expressions - * that are difficult to intepret. + * that are difficult to interpret. * * Polynomial expressions may be constructed from numbers and the * independent variable and other polynomials by the algebraic @@ -43,7 +43,7 @@ * The operations // and % are defined to have the quotient and * remainder meanings as usually defined for polynomials. * - * When polynomials are assigned to idenfifiers, it is convenient to + * When polynomials are assigned to identifiers, it is convenient to * think of the polynomials as values. For example, p = (x - 1)^2 * assigns to p a polynomial value in the same way as q = (7 - 1)^2 * would assign to q a number value. As with number expressions diff --git a/cal/prompt.cal b/cal/prompt.cal index 23b0ef3..288c5d1 100644 --- a/cal/prompt.cal +++ b/cal/prompt.cal @@ -1,5 +1,5 @@ /* - * prompt - eemonstration of some uses of prompt() and eval() + * prompt - demonstration of some uses of prompt() and eval() * * Copyright (C) 1999 Ernest Bowen * @@ -61,9 +61,9 @@ * nothing to sum. The last line returns the value 3, i.e. the last * non-null value found for the expressions separated by semicolons, * so sum will be increased by 3 after the "print sum^2;" command - * is executed. xxx The terminating semicolon is essential in the + * is executed. XXX The terminating semicolon is essential in the * last two lines. A command like eval("print 7;") is acceptable to - * calc but eval("print 7") causes an exit from calc. xxx) + * calc but eval("print 7") causes an exit from calc. XXX) * * If the value returned is not a number (e.g. the name of a list or matrix, * or if the string has syntax errors as in "2 + ", in which case the @@ -75,7 +75,7 @@ * "sin(x)", "x^2 + 3*x", "exp(x, 1e-5)". * * Values of the function so defined are returned for values of x - * entered in reponse to the ? prompt. Operation is terminated by + * entered in response to the ? prompt. Operation is terminated by * entering "end", "exit" or "quit". */ diff --git a/cal/quat.cal b/cal/quat.cal index eac3048..05202d4 100644 --- a/cal/quat.cal +++ b/cal/quat.cal @@ -1,5 +1,5 @@ /* - * quat - alculate using quaternions of the form: a + bi + cj + dk + * quat - calculate using quaternions of the form: a + bi + cj + dk * * Copyright (C) 1999 David I. Bell * diff --git a/cal/randmprime.cal b/cal/randmprime.cal index 05b02bd..ec36ae1 100644 --- a/cal/randmprime.cal +++ b/cal/randmprime.cal @@ -45,9 +45,9 @@ randmprime(bits, seed, dbg) local n; /* n as in h*2^n-1 */ local h; /* h as in h*2^n-1 */ local plush; /* value added to h since the beginning */ - local init; /* initial cpu time */ - local start; /* cpu time before last test */ - local stop; /* cpu time afte last test */ + local init; /* initial CPU time */ + local start; /* CPU time before last test */ + local stop; /* CPU time after last test */ local tmp; /* just a tmp place holder value */ local ret; /* h*2^n-1 that is prime */ diff --git a/cal/regress.cal b/cal/regress.cal index 8d4e6ed..193dc68 100644 --- a/cal/regress.cal +++ b/cal/regress.cal @@ -43,7 +43,7 @@ global prob; /* libregress.cal problem counter */ prob = 0; /* clear problem counter */ errcount(0),; /* clear error count */ -errmax(-1),; /* prevent errcount from abouting */ +errmax(-1),; /* prevent errcount from aborting */ global ecnt; /* expected value of errcount() */ ecnt = 0; /* clear expected errcount() value */ @@ -453,7 +453,7 @@ define test_config() '539: config("more", ">> ") == ";; "'); vrfy(config("all") == oldcfg, '540: config("all") == oldcfg'); - /* restore the configation at the start of this function */ + /* restore the configuration at the start of this function */ vrfy(config("all",callcfg) == oldcfg, '541: config("all",callcfg) == oldcfg'); @@ -3156,7 +3156,7 @@ print '047: parsed test_poly()'; /* - * test_det - more determinent testing + * test_det - more determinant testing */ read -once "test3300"; print '048: read -once test3300'; @@ -3473,7 +3473,7 @@ print '065: parsed test_param()'; /* - * test_noarg - test missing argment functionality + * test_noarg - test missing argument functionality */ define test_noarg() { @@ -5183,7 +5183,7 @@ define test_size() '5715: sizeof(17^139 + 674)*2 == sizeof(q)'); /* - * recipricals are the same size of their integer inverses + * reciprocals are the same size of their integer inverses */ q = 1/13; print '5716: q = 1/13'; @@ -5261,7 +5261,7 @@ define test_size() /* * size of a matrix is the sum of the sizes of the elements - * sizeof of a matrix is the sum of the sizeofs of the elements + * sizeof of a matrix is the sum of the sizeof's of the elements */ mat m[] = {z,q,c}; print '5752: mat m[] = {z,q,c}'; @@ -5381,7 +5381,7 @@ define test_is() { local loc; /* unassigned local variable */ local a; /* assoc */ - local ofd; /* open file desriptor */ + local ofd; /* open file descriptor */ local cfd; /* closed file descriptor */ local blk; /* unnamed block */ local nblk; /* named block */ @@ -5398,7 +5398,7 @@ define test_is() local object; /* object */ local rand; /* rand seed */ local random; /* random seed */ - local real; /* real non-intger value */ + local real; /* real non-integer value */ local prime; /* odd prime */ local square; /* square of an odd prime */ local string; /* string */ @@ -7482,7 +7482,7 @@ print '190: parsed test_somenew()'; /* - * test_exponentiation - test new exponentiation functionaltiy + * test_exponentiation - test new exponentiation functionality */ define test_exponentiation() { @@ -7573,7 +7573,7 @@ define test_quit() quit; prob('quit did not end the test_quit() function'); - /* 8400 serise continued after return, do not print end here */ + /* 8400 series continued after return, do not print end here */ } print '191: parsed test_quit()'; @@ -7874,7 +7874,7 @@ print '8406: Ending test_quit'; /* - * test_divmod - psuedo-random tests on the // and % with various rounding modes + * test_divmod - pseudo-random tests on the // and % with various rounding modes */ print; print '8500: Starting test of divmod' @@ -7900,7 +7900,7 @@ vrfy(config("redecl_warn",0), '8651: config("redecl_warn",0)'); vrfy(config("dupvar_warn",0), '8652: config("dupvar_warn",0)'); vrfy(u_glob == 6, '8653: u_glob == 6'); global u_glob = 555; -print '8654: reclare u_glob'; +print '8654: declare u_glob'; vrfy(u_glob == 555, '8655: u_glob == 555'); define func_8650(u_glob) { local u_glob; return u_glob; } print '8656: u_glob as both local and parameter'; @@ -7928,7 +7928,7 @@ vrfy(dotest("set8700.line", 8703) == 0, /* - * new exponentiation functionaltiy + * new exponentiation functionality */ print; return test_exponentiation(); @@ -8074,7 +8074,7 @@ return test_functions2(); * * beer.cal - prints a bunch of things when loaded * hello.cal - designed to go into an infinite loop - * lucal.cal - already read by this file + * lucas.cal - already read by this file * lucas_chk.cal - already read by this file * regress.cal - this file * surd.cal - already read by this file diff --git a/cal/specialfunctions.cal b/cal/specialfunctions.cal index 955868f..3f8f334 100644 --- a/cal/specialfunctions.cal +++ b/cal/specialfunctions.cal @@ -442,8 +442,8 @@ define lngamma(z) if (tmp2 < tmp) { return newerror(strcat - ("lngamma(1): something happend that ", - "should not have happend")); + ("lngamma(1): something happened ", + "that shouldn't have happened")); } } } @@ -519,8 +519,8 @@ define lngamma(z) if (tmp2 < tmp) { return newerror(strcat - ("lngamma(1): something happend ", - "that should not have happend")); + ("lngamma(1): something happened ", + "that should not have happened")); } } } @@ -576,8 +576,8 @@ define lngamma(z) if (tmp2 < tmp) { return newerror(strcat - ("lngamma(1): something happend ", - "that should not have happend")); + ("lngamma(1): something happened ", + "that should not have happened")); } } } @@ -1047,7 +1047,7 @@ define __CZ__ibeta_cf_var_dm(a, b, z, max) } } if (m > max) { - return newerror("ibeta: continous fraction does not converge"); + return newerror("ibeta: continuous fraction does not converge"); } return f; } @@ -1290,7 +1290,7 @@ define __CZ__erfinvapprox(x) - (2 / (pi() * a) + (ln(1 - x ^ 2)) / 2)); } -/* complementary inverse errror function, faster at about x < 1-.91 +/* complementary inverse error function, faster at about x < 1-.91 Henry E. Fettis. "A stable algorithm for computing the inverse error function in the 'tail-end' region" Math. Comp., 28:585-587, 1974. */ @@ -1324,7 +1324,7 @@ define __CZ__fettiscf(y, n) return t / (1 + r); } -/* inverse errror function, faster at about x<=.91*/ +/* inverse error function, faster at about x<=.91*/ define __CZ__inverfbin(x) { local places approx flow fhigh eps high low mid fmid epsilon; @@ -1370,7 +1370,7 @@ define erfinv(x) x = -x; flag = 1; } - /* No need for full pecision */ + /* No need for full precision */ eps = epsilon(1e-20); if (eps >= 1e-40) { /* Winitzki, Sergei (6 February 2008). "A handy approximation for the diff --git a/cal/statistics.cal b/cal/statistics.cal index f1680a5..ce488f4 100644 --- a/cal/statistics.cal +++ b/cal/statistics.cal @@ -106,7 +106,7 @@ define invbetainc_slow(x,a,b){ GW Cran, KJ Martin, GE Thomas, Remark AS R19 and Algorithm AS 109: A Remark on Algorithms AS 63: The Incomplete Beta Integral - and AS 64: Inverse of the Incomplete Beta Integeral, + and AS 64: Inverse of the Incomplete Beta integral, Applied Statistics, Volume 26, Number 1, 1977, pages 111-114. diff --git a/cal/test2600.cal b/cal/test2600.cal index 3c9aa67..c459c27 100644 --- a/cal/test2600.cal +++ b/cal/test2600.cal @@ -50,7 +50,7 @@ * of b in power(a, b, eps) is large, the computation required for * a test may be very heavy. * - * Test funcations are called as: + * Test functions are called as: * * testabc(str, ..., verbose) * diff --git a/cal/test2700.cal b/cal/test2700.cal index 8f6929b..e1e85e7 100644 --- a/cal/test2700.cal +++ b/cal/test2700.cal @@ -84,7 +84,7 @@ define mkfrac() = rand(2) ? mkposfrac() : -mkposfrac(); define mksquarereal() = mknonnegreal()^2; /* - * We might be able to do better than the following. For nonsquare + * We might be able to do better than the following. For non-square * positive integer less than 1e6, could use: * x = rand(1, 1000); * return rand(x^2 + 1, (x + 1)^2); diff --git a/cal/test5100.cal b/cal/test5100.cal index 8d4ad95..56e6c58 100644 --- a/cal/test5100.cal +++ b/cal/test5100.cal @@ -35,7 +35,7 @@ defaultverbose = 1; /* default verbose value */ * with zero value, when the definition is read. * * The variable a5100 is initialized with the value x if and when this - * function is first called with a positive even x. The varable b5100 + * function is first called with a positive even x. The variable b5100 * is similarly initialized if and when this function is first called positive * odd x. * diff --git a/cal/test8500.cal b/cal/test8500.cal index 01336a5..a6bd736 100644 --- a/cal/test8500.cal +++ b/cal/test8500.cal @@ -169,7 +169,7 @@ define divmod_8500(N = 10, M1 = 2^128, M2 = 2^64, testnum = 0) } /* - * seelect one of the 32 rounding modes at random + * select one of the 32 rounding modes at random */ rnd = rand(32); diff --git a/cal/test8900.cal b/cal/test8900.cal index 5afc7a0..c2de2d3 100644 --- a/cal/test8900.cal +++ b/cal/test8900.cal @@ -26,7 +26,7 @@ static __CZ__eps = 1e-20; /* - * load once, the calc resource functions contribued by Christoph Zurnieden + * load once, the calc resource functions contributed by Christoph Zurnieden */ read -once bernpoly.cal; read -once brentsolve.cal; @@ -45,7 +45,7 @@ read -once intnum.cal; /* * tests of correctness of the functions implemented by the above listed * author. All values tested against have been computed with at least two - * independant algorithms where possible (indicated if not). + * independent algorithms where possible (indicated if not). */ define t01() { @@ -1649,7 +1649,7 @@ define t03() /* test 04 tests polygamma(m,z) for the following values (m==0 gets computed * by psi()). * Values tested against were computed with Mathematica(TM) only - * (z in the left complex halfplane does not get computed yet) + * (z in the left complex half plane does not get computed yet) */ define t04() { diff --git a/cal/toomcook.cal b/cal/toomcook.cal index d3b9a73..2bbb41d 100644 --- a/cal/toomcook.cal +++ b/cal/toomcook.cal @@ -320,16 +320,16 @@ define toomcook4square(a){ } /* - TODO: Implement the asymmetric variations -*/ + * TODO: Implement the asymmetric variations + */ /* - produce_long_random_number(n) returns large pseudorandom numbers. Really large - numbers, e.g.: - produce_long_random_number(16) - is ca 4,128,561 bits (ca 1,242,821 dec. digits) large. Exact length is not - predeterminable because of the chaotic output of the function random(). -*/ + * produce_long_random_number(n) returns large pseudo-random numbers. + * Really large numbers, e.g.: + * produce_long_random_number(16) + * is ca 4,128,561 bits (ca 1,242,821 dec. digits) large. Exact length is not + * pre-determinable because of the chaotic output of the function random(). + */ define __CZ__produce_long_random_number(n) { local ret k; diff --git a/cal/unitfrac.cal b/cal/unitfrac.cal index 6ae755b..058410f 100644 --- a/cal/unitfrac.cal +++ b/cal/unitfrac.cal @@ -1,5 +1,5 @@ /* - * unixfrac - represent a fraction as a sum of distince unit fractions + * unixfrac - represent a fraction as a sum of distance unit fractions * * Copyright (C) 1999 David I. Bell * diff --git a/cal/zeta2.cal b/cal/zeta2.cal index d10b2e3..47547d3 100644 --- a/cal/zeta2.cal +++ b/cal/zeta2.cal @@ -34,7 +34,7 @@ define hurwitzzeta(s,a){ /* According to Linas Vepstas' "An efficient algorithm for accelerating the convergence of oscillatory series, useful for computing the - polylogarithm and Hurwitz zeta functions" the Euler-Maclaurin series + poly-logarithm and Hurwitz zeta functions" the Euler-Maclaurin series is the fastest in most cases. With a lot of help of the PARI/GP implementation by Prof. Henri Cohen, @@ -78,7 +78,7 @@ define hurwitzzeta(s,a){ print "limit = " limit; print "prec = " precision; } - /* Full precison plus 5 digits angstzuschlag*/ + /* Full precision plus 5 digits angstzuschlag*/ epsilon( (10^(-precision)) * 1e-5); tmp3=(a+limit_function+0.)^(-s); sum3 = tmp3/2; diff --git a/calc.h b/calc.h index 92650e5..c015f02 100644 --- a/calc.h +++ b/calc.h @@ -232,8 +232,8 @@ EXTERN int no_env; /* TRUE (-e) => ignore env vars on startup */ EXTERN long errmax; /* if >= 0, error when errcount exceeds errmax */ EXTERN int use_old_std; /* TRUE (-O) => use classic configuration */ -EXTERN int allow_read; /* FALSE => dont open any files for reading */ -EXTERN int allow_write; /* FALSE => dont open any files for writing */ +EXTERN int allow_read; /* FALSE => don't open any files for reading */ +EXTERN int allow_write; /* FALSE => don't open any files for writing */ EXTERN int allow_exec; /* FALSE => may not execute any commands */ /* diff --git a/calc.man b/calc.man index e123c27..644f337 100644 --- a/calc.man +++ b/calc.man @@ -1401,7 +1401,7 @@ gziped (or compressed) tar file). Please try to generate a patch against the most recent version of calc, and if you use GitHub, the top of the master branch: -sp +.sp .nf .in +0.5i https://github.com/lcn2/calc diff --git a/codegen.c b/codegen.c index d9da13f..b7804cd 100644 --- a/codegen.c +++ b/codegen.c @@ -2607,7 +2607,7 @@ getid(char *buf) * global or if symtype is static and the old variable is at the same * level. Warnings are issued when a global or local variable is * redeclared and when in the same body the variable will be accessible only - ^ with the appropriate specfier. + ^ with the appropriate specifier. */ S_FUNC void definesymbol(char *name, int symtype) diff --git a/comfunc.c b/comfunc.c index 0df272f..f3f2e03 100644 --- a/comfunc.c +++ b/comfunc.c @@ -553,7 +553,7 @@ c_log(COMPLEX *c, NUMBER *epsilon) /* first time call */ cln_10_epsilon = qcopy(epsilon); } else if (qcmp(cln_10_epsilon, epsilon) == TRUE) { - /* replaced cacheed value with epsilon arg */ + /* replaced cached value with epsilon arg */ qfree(cln_10_epsilon); cln_10_epsilon = qcopy(epsilon); } else if (cln_10 != NULL) { diff --git a/config.h b/config.h index 719c3a4..361e8b9 100644 --- a/config.h +++ b/config.h @@ -130,7 +130,7 @@ struct config { LEN sq2; /* size of number to use square algorithm 2 */ LEN pow2; /* size of modulus to use REDC for powers */ 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 approximations */ BOOL tab_ok; /* ok to print tab before numeric values */ LEN quomod; /* quomod() default rounding mode */ LEN quo; /* quotient // default rounding mode */ @@ -163,7 +163,7 @@ struct config { BOOL *allow_custom; /* ptr to if custom functions are allowed */ char *version; /* calc version string */ int baseb; /* base for calculations */ - BOOL redecl_warn; /* TRUE => warn of redeclating variables */ + BOOL redecl_warn; /* TRUE => warn of redeclaring variables */ BOOL dupvar_warn; /* TRUE => warn of var name collisions */ }; typedef struct config CONFIG; diff --git a/cscript/README.src b/cscript/README.src index f12fe86..767fb24 100644 --- a/cscript/README.src +++ b/cscript/README.src @@ -76,7 +76,7 @@ mersenne exp piforever - Print the value of pi forever, or as long as you cpu / memory allows. + Print the value of pi forever, or as long as you CPU / memory allows. plus arg ... diff --git a/cscript/piforever.calc b/cscript/piforever.calc index 95a027e..4a289ef 100644 --- a/cscript/piforever.calc +++ b/cscript/piforever.calc @@ -1,6 +1,6 @@ #!/usr/local/src/bin/calc/calc -q -s -f /* - * piforever - print digits of pi forever (or as long as your mem/cpu allow) + * piforever - print digits of pi forever (or as long as your mem/CPU allow) * * Copyright (C) 1999-2007,2014,2019 Landon Curt Noll * diff --git a/custom.c b/custom.c index d8fe2d8..6bc0114 100644 --- a/custom.c +++ b/custom.c @@ -109,7 +109,7 @@ custom(char *name, int count, VALUE **vals) /* - * showcustom - display the names and brief descriptins of custom functions + * showcustom - display the names and brief descriptions of custom functions */ /*ARGSUSED*/ void diff --git a/custom.h b/custom.h index 561176f..5ca3939 100644 --- a/custom.h +++ b/custom.h @@ -35,7 +35,7 @@ * * before they include this file. * - * Keep this file down to a minimum. Don't put custom builtin funcion + * Keep this file down to a minimum. Don't put custom builtin function * stuff in this file! */ @@ -45,7 +45,7 @@ /* - * arg count definitons + * arg count definitions */ #define MAX_CUSTOM_ARGS 100 /* maximum number of custom arguments */ diff --git a/custom/HOW_TO_ADD b/custom/HOW_TO_ADD index 004b208..5dd5fe7 100644 --- a/custom/HOW_TO_ADD +++ b/custom/HOW_TO_ADD @@ -220,7 +220,7 @@ Step 5: Write your custom function NOTE: If you do not use any of the 3 function parameters, then you should declare that function parameter to be UNUSED. For example, if the count and vals parameters were not used - in your custom function, then your declaraction should be: + in your custom function, then your declaration should be: /*ARGSUSED*/ VALUE diff --git a/custom/Makefile b/custom/Makefile index 4af7020..f1b74aa 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -36,7 +36,7 @@ # # make ...__optional_arguments_... target=value -# Try uname -s if the target was not alreadhy set on the make command line +# Try uname -s if the target was not already set on the make command line # ifeq ($(target),) target=$(shell uname -s 2>/dev/null) @@ -125,7 +125,7 @@ Q=@ #INCDIR= /dev/env/DJDIR/include INCDIR= /usr/include -# where to install calc realted things +# where to install calc related things # # ${BINDIR} where to install calc binary files # ${LIBDIR} where calc link library (*.a) files are installed @@ -391,7 +391,7 @@ AWK= awk # NOTE: These should be left blank in this Makefile to make it # easier to add stuff on the command line. If you want to # to change the way calc is compiled by this Makefile, change -# the appropirate host target section below or a flag above. +# the appropriate host target section below or a flag above. # EXTRA_CFLAGS= EXTRA_LDFLAGS= @@ -1084,7 +1084,7 @@ CUSTCALC_OBJ= ${REQUIRED_OBJ} ${CUSTOM_OBJ} # C_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC} -# These .h files are used to build the dependecy list +# These .h files are used to build the dependency list # H_SRC= ${CUSTOM_H_SRC} @@ -1101,7 +1101,7 @@ DISTLIST= ${CUSTCALC_SRC} ${CUSTOM_CALC_FILES} ${CUSTOM_HELP} \ # CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD -# This is the custom dynbamic shared library that is build +# This is the custom dynamic shared library that is build # CALC_DYNAMIC_LIBCUSTCALC= libcustcalc${LIB_EXT_VERSION} @@ -1155,7 +1155,7 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE} ### # -# building calc-static and static lib*.a libraires +# building calc-static and static lib*.a libraries # ### @@ -1174,7 +1174,7 @@ libcustcalc.a: ${CUSTCALC_OBJ} ${MAKE_FILE} # sub-directory called calc/lib. # # NOTE: Due to bogus shells found on one common system we must have -# an non-emoty else clause for every if condition. *sigh* +# an non-empty else clause for every if condition. *sigh* # ## @@ -1213,7 +1213,7 @@ Makefile.simple: ${MAKE_FILE} # Home grown make dependency rules. Your system make not support # or have the needed tools. You can ignore this section. # -# We will form a skelaton tree of *.c files containing only #include "foo.h" +# We will form a skeleton tree of *.c files containing only #include "foo.h" # lines and .h files containing the same lines surrounded by multiple include # prevention lines. This allows us to build a static depend list that will # satisfy all possible cpp symbol definition combinations. @@ -1531,7 +1531,7 @@ uninstall: if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \ echo "cannot uninstall ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ else \ - echo "uninstalled ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ + echo "un-installed ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ fi; \ fi -${Q} for i in ${CUSTOM_HELP} /dev/null; do \ @@ -1543,7 +1543,7 @@ uninstall: if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMHELPDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMHELPDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMHELPDIR}/$$i"; \ fi; \ fi; \ done @@ -1556,7 +1556,7 @@ uninstall: if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMCALDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMCALDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMCALDIR}/$$i"; \ fi; \ fi; \ done @@ -1569,7 +1569,7 @@ uninstall: if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMINCDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMINCDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMINCDIR}/$$i"; \ fi; \ fi; \ done diff --git a/custom/Makefile.head b/custom/Makefile.head index a9cca1e..6760bf2 100644 --- a/custom/Makefile.head +++ b/custom/Makefile.head @@ -36,7 +36,7 @@ # # make ...__optional_arguments_... target=value -# Try uname -s if the target was not alreadhy set on the make command line +# Try uname -s if the target was not already set on the make command line # ifeq ($(target),) target=$(shell uname -s 2>/dev/null) @@ -125,7 +125,7 @@ Q=@ #INCDIR= /dev/env/DJDIR/include INCDIR= /usr/include -# where to install calc realted things +# where to install calc related things # # ${BINDIR} where to install calc binary files # ${LIBDIR} where calc link library (*.a) files are installed @@ -391,7 +391,7 @@ AWK= awk # NOTE: These should be left blank in this Makefile to make it # easier to add stuff on the command line. If you want to # to change the way calc is compiled by this Makefile, change -# the appropirate host target section below or a flag above. +# the appropriate host target section below or a flag above. # EXTRA_CFLAGS= EXTRA_LDFLAGS= diff --git a/custom/Makefile.tail b/custom/Makefile.tail index 69cdc71..5053cd1 100644 --- a/custom/Makefile.tail +++ b/custom/Makefile.tail @@ -32,7 +32,7 @@ CUSTCALC_OBJ= ${REQUIRED_OBJ} ${CUSTOM_OBJ} # C_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC} -# These .h files are used to build the dependecy list +# These .h files are used to build the dependency list # H_SRC= ${CUSTOM_H_SRC} @@ -49,7 +49,7 @@ DISTLIST= ${CUSTCALC_SRC} ${CUSTOM_CALC_FILES} ${CUSTOM_HELP} \ # CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD -# This is the custom dynbamic shared library that is build +# This is the custom dynamic shared library that is build # CALC_DYNAMIC_LIBCUSTCALC= libcustcalc${LIB_EXT_VERSION} @@ -103,7 +103,7 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE} ### # -# building calc-static and static lib*.a libraires +# building calc-static and static lib*.a libraries # ### @@ -122,7 +122,7 @@ libcustcalc.a: ${CUSTCALC_OBJ} ${MAKE_FILE} # sub-directory called calc/lib. # # NOTE: Due to bogus shells found on one common system we must have -# an non-emoty else clause for every if condition. *sigh* +# an non-empty else clause for every if condition. *sigh* # ## @@ -161,7 +161,7 @@ Makefile.simple: ${MAKE_FILE} # Home grown make dependency rules. Your system make not support # or have the needed tools. You can ignore this section. # -# We will form a skelaton tree of *.c files containing only #include "foo.h" +# We will form a skeleton tree of *.c files containing only #include "foo.h" # lines and .h files containing the same lines surrounded by multiple include # prevention lines. This allows us to build a static depend list that will # satisfy all possible cpp symbol definition combinations. @@ -479,7 +479,7 @@ uninstall: if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \ echo "cannot uninstall ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ else \ - echo "uninstalled ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ + echo "un-installed ${T}${CUSTOMCALDIR}/libcustcalc.a"; \ fi; \ fi -${Q} for i in ${CUSTOM_HELP} /dev/null; do \ @@ -491,7 +491,7 @@ uninstall: if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMHELPDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMHELPDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMHELPDIR}/$$i"; \ fi; \ fi; \ done @@ -504,7 +504,7 @@ uninstall: if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMCALDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMCALDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMCALDIR}/$$i"; \ fi; \ fi; \ done @@ -517,7 +517,7 @@ uninstall: if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \ echo "cannot uninstall ${T}${CUSTOMINCDIR}/$$i"; \ else \ - echo "uninstalled ${T}${CUSTOMINCDIR}/$$i"; \ + echo "un-installed ${T}${CUSTOMINCDIR}/$$i"; \ fi; \ fi; \ done diff --git a/custom/c_pmodm127.c b/custom/c_pmodm127.c index 60aeca3..9887bfc 100644 --- a/custom/c_pmodm127.c +++ b/custom/c_pmodm127.c @@ -124,7 +124,7 @@ c_pmodm127(char UNUSED *name, int UNUSED count, VALUE **vals) result.v_type = V_NUM; /* - * compute 2^(2^127-1) mod q by modular exponentation + * compute 2^(2^127-1) mod q by modular exponentiation * * We implement the following calc code in C: * diff --git a/custom/c_pzasusb8.c b/custom/c_pzasusb8.c index 16b68a1..bcf168a 100644 --- a/custom/c_pzasusb8.c +++ b/custom/c_pzasusb8.c @@ -1,5 +1,5 @@ /* - * c_pzasusb8 - print numereator as a string of USB8s + * c_pzasusb8 - print numerator as a string of USB8s * * Copyright (C) 1999-2004 Ernest Bowen * @@ -36,7 +36,7 @@ #include "have_unused.h" /* - * c_pzasusb8 - print numereator as a string of USB8s + * c_pzasusb8 - print numerator as a string of USB8s * * given: * count = 1; diff --git a/custom/c_sysinfo.c b/custom/c_sysinfo.c index 67d35ee..5789936 100644 --- a/custom/c_sysinfo.c +++ b/custom/c_sysinfo.c @@ -177,15 +177,15 @@ STATIC struct infoname sys_info[] = { (FULL)MAXUFULL}, {"MAXULONG", "largest unsigned long val", NULL, (FULL)MAXULONG}, - {"MAX_MAP_PRIME", "larest prime in pr_map", NULL, + {"MAX_MAP_PRIME", "largest prime in pr_map", NULL, (FULL)MAX_MAP_PRIME}, - {"MAX_MAP_VAL", "larest bit in pr_map", NULL, + {"MAX_MAP_VAL", "largest bit in pr_map", NULL, (FULL)MAX_MAP_VAL}, {"MAX_PFACT_VAL", "max x, for which pfact(x) is a long", NULL, (FULL)MAX_PFACT_VAL}, - {"MAX_SM_PRIME", "larest 32 bit prime", NULL, + {"MAX_SM_PRIME", "largest 32 bit prime", NULL, (FULL)MAX_SM_PRIME}, - {"MAX_SM_VAL", "larest 32 bit value", NULL, + {"MAX_SM_VAL", "largest 32 bit value", NULL, (FULL)MAX_SM_VAL}, {"MUL_ALG2", "default size for alternative multiply", NULL, (FULL)MUL_ALG2}, diff --git a/custom/custtbl.c b/custom/custtbl.c index 8c03979..3f1d19e 100644 --- a/custom/custtbl.c +++ b/custom/custtbl.c @@ -40,7 +40,7 @@ /* - * add your forward custom function declaractions here + * add your forward custom function declarations here * * Declare custom functions as follows: * diff --git a/custom/devnull b/custom/devnull index 2bdc6d1..fe0a2ca 100644 --- a/custom/devnull +++ b/custom/devnull @@ -10,7 +10,7 @@ TYPES return null DESCRIPTION - This custom function does nothing. It is intented for testing + This custom function does nothing. It is intended for testing of the general custom interface. EXAMPLE diff --git a/custom/pzasusb8 b/custom/pzasusb8 index 8b5c98a..44faf88 100644 --- a/custom/pzasusb8 +++ b/custom/pzasusb8 @@ -21,7 +21,7 @@ DESCRIPTION for details. - This custom function is intented for testing of the general + This custom function is intended for testing of the general custom interface. EXAMPLE diff --git a/custom/pzasusb8.cal b/custom/pzasusb8.cal index 46d749f..98dd38d 100644 --- a/custom/pzasusb8.cal +++ b/custom/pzasusb8.cal @@ -1,5 +1,5 @@ /* - * pzasusb8 - print numereator as a string of USB8s + * pzasusb8 - print numerator as a string of USB8s * * Copyright (C) 1999,2004 Ernest Bowen and Landon Curt Noll * diff --git a/custom/register b/custom/register index cfe536e..f86f8bf 100644 --- a/custom/register +++ b/custom/register @@ -20,14 +20,14 @@ DESCRIPTION The number of custom registers is defined at compile time. There will be at least 32 registers although there could be more - added in the future. It may be deterimed by: + added in the future. It may be determined by: custom("sysinfo", "REGNUM_MAX") The custom registers are initialized to 0 by the internal function libcalc_call_me_first() during calc startup. - This custom interface is intented to make it easier to interface + This custom interface is intended to make it easier to interface with special purpose hardware. EXAMPLE @@ -46,7 +46,7 @@ EXAMPLE LIMITS calc must be built with ALLOW_CUSTOM= -DCUSTOM calc must be executed with a -C arg. - The regnum numbe bee an integer >= 0 and < REGNUM_MAX where + The regnum number bee an integer >= 0 and < REGNUM_MAX where REGNUM_MAX is a compile time constant that is >= 32. LIBRARY diff --git a/custom/sysinfo b/custom/sysinfo index dd19c31..6006327 100644 --- a/custom/sysinfo +++ b/custom/sysinfo @@ -13,7 +13,7 @@ DESCRIPTION This custom function will return the value certain selected #define values. The infoname arg must be a string that matches the given - #define name. For conveience, the case infoname does not matter, + #define name. For convenience, the case infoname does not matter, so "baseb" and "BASEB" refer to the same #define value. The return value is either an integer or a string depending on diff --git a/endian.c b/endian.c index 702898c..7fb729a 100644 --- a/endian.c +++ b/endian.c @@ -25,7 +25,7 @@ */ /* - * Big Endian: Amdahl, 68k, Pyramid, Mips, Sparc, ... + * Big Endian: Amdahl, 68k, Pyramid, MIPS, Sparc, ... * Little Endian: Vax, 32k, Spim (Dec Mips), i386, i486, ... */ diff --git a/file.c b/file.c index e283972..0ea9cb9 100644 --- a/file.c +++ b/file.c @@ -99,7 +99,7 @@ S_FUNC void fskipnum(FILE *fp); /* - * file_init - perform needed initilization work + * file_init - perform needed initialization work * * On some systems, one cannot initialize a pointer to a FILE *. * This routine, called once at startup is a work-a-round for @@ -240,7 +240,7 @@ init_fileio(FILEIO *fiop, char *name, char *mode, * determine file open mode * * While a leading 'r' is for reading and a leading 'w' is - * for writing, the presense of a '+' in the string means + * for writing, the presence of a '+' in the string means * both reading and writing. A leading 'a' means append * which is writing. */ @@ -1408,7 +1408,7 @@ z2filepos(ZVALUE zpos) /* * firewall */ - zpos.sign = 0; /* deal only with the absolue value */ + zpos.sign = 0; /* deal only with the absolute value */ /* * quick return if the position can fit into a long @@ -1649,7 +1649,7 @@ set_open_pos(FILE *fp, ZVALUE zpos) } /* - * return sucess + * return success */ return 0; } @@ -2606,7 +2606,7 @@ isattyid(FILEID id) * given: * id FILEID to search * str string to look for - * pos file postion to start at (NULL => current position) + * pos file position to start at (NULL => current position) * * returns: * EOF if system error @@ -2616,7 +2616,7 @@ isattyid(FILEID id) * * XXX - This search is a translation of the original search that did not * work with large files. The search algorithm used is slow and - * should be spead up much more. + * should be speed up much more. */ int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res) diff --git a/file.h b/file.h index 7c1b1f5..e048bce 100644 --- a/file.h +++ b/file.h @@ -63,7 +63,7 @@ typedef struct { * Seek loc bytes from the beginning of the open file, stream. * * f_tell(FILE *stream, FILEPOS *loc) - * Set loc to bytes from the beinning of the open file, stream. + * Set loc to bytes from the beginning of the open file, stream. * * We assume that if your system does not have fgetpos/fsetpos, * then it will have a FILEPOS that is a scalar type (e.g., long). diff --git a/fposval.c b/fposval.c index 5bcdf9b..c0eebc1 100644 --- a/fposval.c +++ b/fposval.c @@ -122,7 +122,7 @@ main(int argc, char **argv) #else /* HAVE_FILEPOS_SCALAR */ /* * Normally a "(*(dest) = *(src))" would do, but on some - * systems a FILEPOS is not a scalar hince we must memcpy. + * systems a FILEPOS is not a scalar hence we must memcpy. */ printf("#define SWAP_HALF_IN_FILEPOS(dest, src)\t%s\n", "\\\n\tmemcpy((void *)(dest), (void *)(src), " @@ -163,7 +163,7 @@ main(int argc, char **argv) * Little Endian * * Normally a "(*(dest) = *(src))" would do, but on some - * systems an off_t is not a scalar hince we must memcpy. + * systems an off_t is not a scalar hence we must memcpy. */ #if defined(HAVE_OFF_T_SCALAR) printf("#define SWAP_HALF_IN_OFF_T(dest, src)\t\t%s\n", @@ -171,7 +171,7 @@ main(int argc, char **argv) #else /* HAVE_OFF_T_SCALAR */ /* * Normally a "(*(dest) = *(src))" would do, but on some - * systems, a off_t is not a scalar hince we must memcpy. + * systems, a off_t is not a scalar hence we must memcpy. */ printf("#define SWAP_HALF_IN_OFF_T(dest, src)\t%s%d%s\n", "memcpy((void *)(dest), (void *)(src), ", stsizelen/8, ")"); @@ -214,7 +214,7 @@ main(int argc, char **argv) * Little Endian * * Normally a "(*(dest) = *(src))" would do, but on some - * systems, a DEV is not a scalar hince we must memcpy. + * systems, a DEV is not a scalar hence we must memcpy. */ printf("#define SWAP_HALF_IN_DEV(dest, src)\t%s%d%s\n", "memcpy((void *)(dest), (void *)(src), ", devlen/8, ")"); @@ -256,7 +256,7 @@ main(int argc, char **argv) * Little Endian * * Normally a "(*(dest) = *(src))" would do, but on some - * systems, a INODE is not a scalar hince we must memcpy. + * systems, a INODE is not a scalar hence we must memcpy. */ printf("#define SWAP_HALF_IN_INODE(dest, src)\t%s%d%s\n", "memcpy((void *)(dest), (void *)(src), ", inodelen/8, ")"); diff --git a/func.c b/func.c index b81775d..42e28a1 100644 --- a/func.c +++ b/func.c @@ -5538,7 +5538,7 @@ f_usertime(void) NUMBER *secret; /* whole sconds of CPU time to return */ NUMBER *usecret; /* microseconds of CPU time to return */ - /* get the resource informaion for ourself */ + /* get the resource information for ourself */ status = getrusage(who, &usage); if (status < 0) { /* system call error, so return 0 */ @@ -5577,7 +5577,7 @@ f_systime(void) NUMBER *secret; /* whole sconds of CPU time to return */ NUMBER *usecret; /* microseconds of CPU time to return */ - /* get the resource informaion for ourself */ + /* get the resource information for ourself */ status = getrusage(who, &usage); if (status < 0) { /* system call error, so return 0 */ @@ -5617,7 +5617,7 @@ f_runtime(void) NUMBER *secret; /* whole sconds of CPU time to return */ NUMBER *usecret; /* microseconds of CPU time to return */ - /* get the resource informaion for ourself */ + /* get the resource information for ourself */ status = getrusage(who, &usage); if (status < 0) { /* system call error, so return 0 */ @@ -5734,7 +5734,7 @@ f_fpathopen(int count, VALUE **vals) /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - /* check for valid strongs */ + /* check for valid strong */ if (vals[0]->v_type != V_STR || vals[1]->v_type != V_STR) { return error_value(E_FPATHOPEN1); } @@ -7840,7 +7840,7 @@ f_base(int count, NUMBER **vals) return base_value(conf->outmode, conf->outmode); } - /* deal with the specal modes first */ + /* deal with the special modes first */ if (qisfrac(vals[0])) { return base_value(math_setmode(MODE_FRAC), conf->outmode); } @@ -7891,7 +7891,7 @@ f_base2(int count, NUMBER **vals) return base_value(conf->outmode2, conf->outmode2); } - /* deal with the specal modes first */ + /* deal with the special modes first */ if (qisfrac(vals[0])) { return base_value(math_setmode2(MODE_FRAC), conf->outmode2); } @@ -8511,7 +8511,7 @@ f_version(void) { VALUE result; - /* return the calc verstion string */ + /* return the calc version string */ result.v_type = V_STR; result.v_subtype = V_NOSUBTYPE; result.v_str = makestring(strdup(version())); @@ -8577,7 +8577,7 @@ STATIC CONST struct builtin builtins[] = { {"acsch", 1, 2, 0, OP_NOP, 0, f_acsch, "inverse csch of a within accuracy b"}, {"agd", 1, 2, 0, OP_NOP, 0, f_agd, - "inverse gudermannian function"}, + "inverse Gudermannian function"}, {"append", 1, IN, FA, OP_NOP, 0, f_listappend, "append values to end of list"}, {"appr", 1, 3, 0, OP_NOP, 0, f_appr, @@ -8788,7 +8788,7 @@ STATIC CONST struct builtin builtins[] = { {"gcdrem", 2, 2, 0, OP_NOP, qgcdrem, 0, "a divided repeatedly by gcd with b"}, {"gd", 1, 2, 0, OP_NOP, 0, f_gd, - "gudermannian function"}, + "Gudermannian function"}, {"getenv", 1, 1, 0, OP_NOP, 0, f_getenv, "value of environment variable (or NULL)"}, {"hash", 1, IN, 0, OP_NOP, 0, f_hash, @@ -9068,7 +9068,7 @@ STATIC CONST struct builtin builtins[] = { "reverse search matrix or list for value b\n" "\t\t\tstarting at index c"}, {"runtime", 0, 0, 0, OP_NOP, f_runtime, 0, - "user and kernel mode cpu time in seconds"}, + "user and kernel mode CPU time in seconds"}, {"saveval", 1, 1, 0, OP_SAVEVAL, 0, 0, "set flag for saving values"}, {"scale", 2, 2, 0, OP_SCALE, 0, 0, @@ -9087,7 +9087,7 @@ STATIC CONST struct builtin builtins[] = { {"sech", 1, 2, 0, OP_NOP, 0, f_sech, "hyperbolic secant of a within accuracy b"}, {"seed", 0, 0, 0, OP_NOP, f_seed, 0, - "return a 64 bit seed for a psuedo-random generator"}, + "return a 64 bit seed for a pseudo-random generator"}, {"segment", 2, 3, 0, OP_NOP, 0, f_segment, "specified segment of specified list"}, {"select", 2, 2, 0, OP_NOP, 0, f_select, @@ -9161,7 +9161,7 @@ STATIC CONST struct builtin builtins[] = { {"system", 1, 1, 0, OP_NOP, 0, f_system, "call Unix command"}, {"systime", 0, 0, 0, OP_NOP, f_systime, 0, - "kernel mode cpu time in seconds"}, + "kernel mode CPU time in seconds"}, {"tail", 2, 2, 0, OP_NOP, 0, f_tail, "retain list of specified number at tail of list"}, {"tan", 1, 2, 0, OP_NOP, 0, f_tan, @@ -9177,7 +9177,7 @@ STATIC CONST struct builtin builtins[] = { {"ungetc", 2, 2, 0, OP_NOP, 0, f_ungetc, "unget char read from file"}, {"usertime", 0, 0, 0, OP_NOP, f_usertime, 0, - "user mode cpu time in seconds"}, + "user mode CPU time in seconds"}, {"version", 0, 0, 0, OP_NOP, 0, f_version, "calc version string"}, {"xor", 1, IN, 0, OP_NOP, 0, f_xor, @@ -9194,7 +9194,7 @@ STATIC CONST struct builtin builtins[] = { * * When FUNCLIST is defined, we are being compiled by rules from the help * sub-directory to form a program that will produce the main part of the - * buiiltin help file. + * builtin help file. * * See the builtin rule in the help/Makefile for details. */ diff --git a/hash.c b/hash.c index e121760..38e8dbb 100644 --- a/hash.c +++ b/hash.c @@ -270,7 +270,7 @@ hash_final(HASH *state) * The input is a long. If a long is smaller than 64 bits, we will * hash a final 32 bits of zeros. * - * This function is OK to hash BOOL's, unslogned long's, unsigned int's + * This function is OK to hash BOOL's, unsigned long's, unsigned int's * signed int's as well as FLAG's and LEN's. */ HASH * diff --git a/have_const.c b/have_const.c index 8628b01..1df3de3 100644 --- a/have_const.c +++ b/have_const.c @@ -1,5 +1,5 @@ /* - * have_const - Determine if we want or can support ansi const + * have_const - Determine if we want or can support ANSI const * * Copyright (C) 1999 Landon Curt Noll * diff --git a/have_offscl.c b/have_offscl.c index 99fc4b2..6efb3ee 100644 --- a/have_offscl.c +++ b/have_offscl.c @@ -55,8 +55,8 @@ int main(void) { #if !defined(OFF_T_NON_SCALAR) - off_t value; /* an off_t to perform arithmatic on */ - off_t value2; /* an off_t to perform arithmatic on */ + off_t value; /* an off_t to perform arithmetic on */ + off_t value2; /* an off_t to perform arithmetic on */ /* * do some math opts on an off_t diff --git a/have_posscl.c b/have_posscl.c index 2c3ef6b..577a115 100644 --- a/have_posscl.c +++ b/have_posscl.c @@ -55,8 +55,8 @@ int main(void) { #if !defined(FILEPOS_NON_SCALAR) - FILEPOS value; /* an FILEPOS to perform arithmatic on */ - FILEPOS value2; /* an FILEPOS to perform arithmatic on */ + FILEPOS value; /* an FILEPOS to perform arithmetic on */ + FILEPOS value2; /* an FILEPOS to perform arithmetic on */ /* * do some math opts on an FILEPOS diff --git a/help/Makefile b/help/Makefile index 24437a9..81ddfb6 100644 --- a/help/Makefile +++ b/help/Makefile @@ -69,7 +69,7 @@ TOP_MAKE_FILE= Makefile #INCDIR= /dev/env/DJDIR/include INCDIR= /usr/include -# where to install calc realted things +# where to install calc related things # # ${BINDIR} where to install calc binary files # ${LIBDIR} where calc link library (*.a) files are installed @@ -209,7 +209,7 @@ BLT_HELP_FILES_5= errorcodes STD_HELP_FILES_6= file history interrupt list mat -# beacuse obj is built special (due to confusion with it as +# because obj is built special (due to confusion with it as # a symlink for some built environments, we treat obj specially # and call it obj.file # @@ -249,7 +249,7 @@ FULL_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \ ${BLT_HELP_FILES_13} ${STD_HELP_FILES_14} \ ${BLT_HELP_FILES_14} ${STD_HELP_FILES_15} -# These full files are those who are not built or constrcuted +# These full files are those who are not built or constructed # STD_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \ ${STD_HELP_FILES_4} ${STD_HELP_FILES_6} \ @@ -271,7 +271,7 @@ BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \ # The detailed list of help files to install # -# This list is prodiced by the detaillist rule when no WARNINGS are detected. +# This list is produced by the detaillist rule when no WARNINGS are detected. # # Please use: # @@ -338,7 +338,7 @@ all: ${FULL_HELP_FILES} full ${DETAIL_HELP} ${DETAIL_CLONE} \ # used by the upper level Makefile to determine of we have done all # # NOTE: Due to bogus shells found on one common system we must have -# an non-emoty else clause for every if condition. *sigh* +# an non-empty else clause for every if condition. *sigh* # .all: ${RM} -f .all @@ -596,18 +596,18 @@ ${SINGULAR_FILES}: ${PLURAL_FILES} # Form the builtin file # -# We ave a "chicken-and-egg" problem. We want the builtn help file to +# We have a "chicken-and-egg" problem. We want the builtin help file to # accurately reflect the function list. It would be nice if we could # just execute calc show builtin, but calc may not have been built or -# buildable at this point. The hack-a-round used is to convert ../func.c -# into a standalone program that generates a suitable function list -# that is standwiched between the top and bottom builtin help text. +# build-able at this point. The hack-a-round used is to convert ../func.c +# into a stand-alone program that generates a suitable function list +# that is sandwiched between the top and bottom builtin help text. # # We form funclist.c by sedding out unwanted stuff from builtins table, # converting NUMBER* and VALUE into harmless types and converting # the showbuiltins() function into main(). Combined with the -DFUNCLIST # we will avoid all of the complex calc types, macros and defines and -# be left with just main() and a mininal builtins table. +# be left with just main() and a minimal builtins table. # # Building funclist.o a portable fashion is ugly because some systems # do not treat -I.. correctly! @@ -662,7 +662,7 @@ calcliblist: done # The BSDI cdrom makefile expects all help files to be pre-built. This rule -# creats these fils so that the release can be shipped off to BSDI. You can +# creates these files so that the release can be shipped off to BSDI. You can # ignore this rule. # bsdi: all diff --git a/help/address b/help/address index ba0d299..be441d2 100644 --- a/help/address +++ b/help/address @@ -75,7 +75,7 @@ DESCRIPTION Except in cases like strcat(A, "") when *A identified with a literal string as above, definitions of string values using strcat() or substr() will copy the relevant strings to newly allocated addresses which will - be useable only while the variables retain these defined values. + be usable only while the variables retain these defined values. For example, after ; B = C = strcat("a", "bc"); diff --git a/help/agd b/help/agd index fe3299a..31a077b 100644 --- a/help/agd +++ b/help/agd @@ -1,5 +1,5 @@ NAME - agd - inverse gudermannian function + agd - inverse Gudermannian function SYNOPSIS agd(z [,eps]) @@ -11,7 +11,7 @@ TYPES return number or infinite error value DESCRIPTION - Calculate the inverse gudermannian of z to a nultiple of eps with + Calculate the inverse Gudermannian of z to a multiple of eps with errors in real and imaginary parts less in absolute value than .75 * eps, or an error value if z is very close to one of the one of the branch points of agd(z).. diff --git a/help/builtin.end b/help/builtin.end index 0467845..46ea01b 100644 --- a/help/builtin.end +++ b/help/builtin.end @@ -56,7 +56,7 @@ ptest(a,1,0) Normally ptest performs a some checks to determine if the - value is divisable by some trivial prime. If the 2nd + value is divisible by some trivial prime. If the 2nd argument is < 0, then the trivial check is omitted. For example, ptest(a,10) performs the same work as: diff --git a/help/catalan b/help/catalan index 7f6653c..b9ff92a 100644 --- a/help/catalan +++ b/help/catalan @@ -20,7 +20,7 @@ DESCRIPTION combinatorial problems, e.g. for n >= 1, catalan(n) is the number of ways of using parentheses to express a product of n + 1 letters in terms of binary products; it is the number of ways of dissecting a - convex polygon with n + 2 sides into triangles by nonintersecting + convex polygon with n + 2 sides into triangles by non-intersecting diagonals; it is the number of integer-component-incrementing paths from (x,y) = (0,0) to (x,y) = (n,n) for which always y <= x. diff --git a/help/cfsim b/help/cfsim index 9250273..83672aa 100644 --- a/help/cfsim +++ b/help/cfsim @@ -30,7 +30,7 @@ DESCRIPTION This corresponds to the use of rnd for functions like round(x, n, rnd). If bit 3 or 4 of rnd is set, the lower order bits are ignored; bit 3 - is ignored if bit 4 is set. Thusi, for rnd > 3, it sufficient to + is ignored if bit 4 is set. Thus, for rnd > 3, it sufficient to consider the two cases rnd = 8 and rnd = 16. If den(x) > 2, cfsim(x, 8) returns the value of the penultimate simple diff --git a/help/cmp b/help/cmp index 1c27231..6e82b7e 100644 --- a/help/cmp +++ b/help/cmp @@ -47,7 +47,7 @@ DESCRIPTION obj point {x,y}; if points with real components are to be partially ordered by their - euclidean distance from the origin, an appropriate point_rel + Euclidean distance from the origin, an appropriate point_rel function may be that given by define point_rel(a,b) = sgn(a.x^2 + a.y^2 - b.x^2 - b.y^2); diff --git a/help/command b/help/command index 969ca2a..3457c53 100644 --- a/help/command +++ b/help/command @@ -200,7 +200,7 @@ Command sequence cd cd dir - Change the current directory to 'dir'. If 'dir' is ommitted, + Change the current directory to 'dir'. If 'dir' is omitted, change the current directory to the home directory, if $HOME is set in the environment. @@ -286,10 +286,10 @@ Command sequence q() defined a() defined - start statment #1 + start statement #1 quit from q() - after statment #1 - start statment #2 + after statement #1 + start statement #2 abort from a() The QUIT within the q() function prevented the ``end of q()'' @@ -309,10 +309,10 @@ Command sequence q() defined a() defined - start statment #1 + start statement #1 quit from q() - after statment #1 - start statment #2 + after statement #1 + start statement #2 abort from a() ; <==== calc interactive prompt @@ -330,10 +330,10 @@ Command sequence q() defined a() defined - start statment #1 + start statement #1 quit from q() - after statment #1 - start statment #2 + after statement #1 + start statement #2 abort from a() The ABORT inside function a() halts the processing of statements @@ -352,11 +352,11 @@ Command sequence a() defined ; x = 3; ; {print "start #1"; if (x > 1) q()} print "after #1"; - start statment #1 + start statement #1 quit from q() - after statment #1 + after statement #1 ; {print "start #2"; if (x > 1) a()} print "after #2"; - start statment #2 + start statement #2 abort from a() ; {print "start #3"; if (x > 1) quit "quit from 3rd statement"} start #3 diff --git a/help/config b/help/config index 9511488..3087c85 100644 --- a/help/config +++ b/help/config @@ -25,7 +25,7 @@ DESCRIPTION "trace" turns tracing features on or off "display" sets number of digits in prints. - "epsilon" sets error value for transcendentals. + "epsilon" sets error value for transcendental. "maxprint" sets maximum number of elements printed. "mode" sets printout mode. "mode2" sets 2nd base printout mode. diff --git a/help/define b/help/define index 1794ae7..50a2cc1 100644 --- a/help/define +++ b/help/define @@ -52,7 +52,7 @@ DESCRIPTION In the definition of a function, the builtin function param(n) provides a way of referring to the parameters. If n (which may - result from evaluating an expreession) is zero, it returns the number + result from evaluating an expression) is zero, it returns the number of arguments in a call to the function, and if 1 <= n <= param(0), param(n) refers to the parameter with index n. @@ -63,7 +63,7 @@ DESCRIPTION In the statement form, if a return statement is encountered, the "return" keyword is to be either immediately followed by an - expression or by a statement terminator (semicolon or rightbrace); + expression or by a statement terminator (semicolon or right-brace); in the former case, the expression is evaluated, evaluation of the function ceases, and the value obtained for the expression is returned as the "value of the function"; in the no-expression case, @@ -93,7 +93,7 @@ DESCRIPTION definition has no effect on the new definition, but if the definition is completed successfully, the new definition replaces the old one; otherwise the old definition is retained. The number of parameters - and their names in the new definiton may be quite different from + and their names in the new definition may be quite different from those in the old definition. An attempt at a definition may fail because of scanerrors as the diff --git a/help/digits b/help/digits index 8b3d99e..cb82da1 100644 --- a/help/digits +++ b/help/digits @@ -25,7 +25,7 @@ DESCRIPTION digits(12.3456) == 2 computes with the integer part only digits(-1234) == 4 computes with the absolute value only - digits(0) == 1 specical case + digits(0) == 1 special case digits(-0.123) == 1 combination of all of the above EXAMPLE diff --git a/help/estr b/help/estr index 3ad5708..effdf80 100644 --- a/help/estr +++ b/help/estr @@ -22,7 +22,7 @@ DESCRIPTION or is not an octal digit, and other non-text characters to their escaped hex representation, e.g. char(165) becomes \xa5. - For real x, estr(x) represebts x in fractional mode. + For real x, estr(x) represents x in fractional mode. EXAMPLE diff --git a/help/euler b/help/euler index 03c1d30..d6a6257 100644 --- a/help/euler +++ b/help/euler @@ -21,7 +21,7 @@ DESCRIPTION If euler(k) is called with negative k, zero is returned and the memory used by the table iu freed. - Considerable runtime and memery are required for calculating + Considerable runtime and memory are required for calculating euler(n) for large even n. EXAMPLE diff --git a/help/fgetfield b/help/fgetfield index 61f0a8f..fcfd5b9 100644 --- a/help/fgetfield +++ b/help/fgetfield @@ -16,7 +16,7 @@ DESCRIPTION null value is returned. Otherwise the function returns the empty string "" if the first non-white character is '\0', and in other cases, the string formed by the non-white-space characters read until '\0' or - a white-space character or te end of the file is reached. In the + a white-space character or the end of the file is reached. In the cases where the reading is stopped by '\0' or white-space character, the file position will be that immediately after that character. diff --git a/help/freopen b/help/freopen index 1a20203..23ae772 100644 --- a/help/freopen +++ b/help/freopen @@ -1,5 +1,5 @@ NAME - freopen - close (if necessary) and reopen a filestream + freopen - close (if necessary) and reopen a file stream SYNOPSIS freopen(fs, mode [,filename]) diff --git a/help/gd b/help/gd index dc026d9..8670c10 100644 --- a/help/gd +++ b/help/gd @@ -1,5 +1,5 @@ NAME - gd - gudermannian function + gd - Gudermannian function SYNOPSIS gd(z [,eps]) @@ -11,7 +11,7 @@ TYPES return number or "Log of zero or infinity" error value DESCRIPTION - Calculate the gudermannian of z to a nultiple of eps with errors in + Calculate the Gudermannian of z to a multiple of eps with errors in real and imaginary parts less in absolute value than .75 * eps, or return an error value if z is close to one of the branch points at odd multiples of (pi/2) * i. diff --git a/help/inputlevel b/help/inputlevel index 2f277d5..7f1d5c3 100644 --- a/help/inputlevel +++ b/help/inputlevel @@ -14,7 +14,7 @@ DESCRIPTION eval(S) for some expression S which evaluates to a string. It decreases by 1 when a file being read reaches EOF or a string being eval-ed reaches '\0', or earlier if a quit statement is - encountered at top calculation-level in the flle or string. It + encountered at top calculation-level in the file or string. It decreases to zero if an abort statement is encountered at any function-level in the file or string. If a quit or abort statement is encountered at top calculation-level at top input-level, diff --git a/help/isatty b/help/isatty index 269aeb1..305b365 100644 --- a/help/isatty +++ b/help/isatty @@ -1,5 +1,5 @@ NAME - isatty - returns 1 if fd assocatied with a tty + isatty - returns 1 if fd is associated with a tty SYNOPSIS isatty(fd) diff --git a/help/isptr b/help/isptr index 5b91f92..d28ce0f 100644 --- a/help/isptr +++ b/help/isptr @@ -18,7 +18,7 @@ DESCRIPTION 3 if x is a string-pointer 4 if x is a number-pointer - Pointers are initially defined by using the addreess (&) operator + Pointers are initially defined by using the address (&) operator with an "addressable" value; currently, these are octets, lvalues, strings and real numbers. diff --git a/help/jacobi b/help/jacobi index 67da436..34d1433 100644 --- a/help/jacobi +++ b/help/jacobi @@ -184,7 +184,7 @@ DESCRIPTION The above calc pseudo code is provided to help illustrate the properties of the jacobi symbol only. The use of calc's jacobi builtin is recommended for both speed as well as to handle - specical cases. + special cases. For more information on the Legendre symbol and the Jacobi symbol: diff --git a/help/max b/help/max index 53ff9b7..73e971a 100644 --- a/help/max +++ b/help/max @@ -12,7 +12,7 @@ TYPES DESCRIPTION If an argument x_i is a list with elements e_1, e_2, ..., e_n, it is treated as if x_i were replaced by e_1, e_2, ..., e_n; this may - continue recurively if any of the e_j is a list. + continue recursively if any of the e_j is a list. If an argument x_i is an object of type xx, then x_i is replaced by xx_max(x_i) if the function xx_max() has been defined. If the @@ -29,14 +29,14 @@ DESCRIPTION will return the same as max(a, b, c). Assuming the above replacements, and that the x_1, x_2, ..., are - of sufficently simple ordered types (e.g. real numbers or strings), + of sufficiently simple ordered types (e.g. real numbers or strings), or, if some are objects, the relevant xx_rel(a,b) has been defined and returns a real-number value for any comparison that has to be made, max(x_1, x_2, ...) returns the value determined by max(x_1) = x_1, - and succesively for later arguments, by the use of the equivalent of + and successively for later arguments, by the use of the equivalent of max(a,b) = (a < b) ? b : a. If the ordering determined by < is total, max(x_1, ...) will be the maximum value among the arguments. For a - preorder relation it may be one of several maximal values. For + pre-order relation it may be one of several maximal values. For other relations, it may be difficult to predict the result. EXAMPLE diff --git a/help/memsize b/help/memsize index 55aebe8..9fba1e8 100644 --- a/help/memsize +++ b/help/memsize @@ -12,13 +12,13 @@ TYPES DESCRIPTION This is analogous to the C operator sizeof. It attempts to assess the number of bytes in memory used to store a value and all its - components plus all of the related structue overhead. Unlike + components plus all of the related structure overhead. Unlike sizeof(x), this builtin includes overhead. - Unlike size(x), this builtin incldues the trailing \0 byte on the + Unlike size(x), this builtin includes the trailing \0 byte on the end of strings. - Unlike sizeof(x), this builtin includes the size demonitor for integers + Unlike sizeof(x), this builtin includes the size denominator for integers and the imaginary part for complex values. Storage for holding 0, 1 and -1 values are also included. diff --git a/help/meq b/help/meq index 2121833..3d51bf7 100644 --- a/help/meq +++ b/help/meq @@ -1,5 +1,5 @@ NAME - meq - test for equality modulo a specifed number + meq - test for equality modulo a specified number SYNOPSIS meq(x, y, md) diff --git a/help/min b/help/min index 27254ab..122a521 100644 --- a/help/min +++ b/help/min @@ -12,7 +12,7 @@ TYPES DESCRIPTION If an argument x_i is a list with elements e_1, e_2, ..., e_n, it is treated as if x_i were replaced by e_1, e_2, ..., e_n; this may - continue recurively if any of the e_j is a list. + continue recursively if any of the e_j is a list. If an argument x_i is an object of type xx, then x_i is replaced by xx_min(x_i) if the function xx_min() has been defined. If the @@ -29,14 +29,14 @@ DESCRIPTION will return the same as min(a, b, c). Assuming the above replacements, and that the x_1, x_2, ..., are - of sufficently simple ordered types (e.g. real numbers or strings), + of sufficiently simple ordered types (e.g. real numbers or strings), or, if some are objects, the relevant xx_rel(a,b) has been defined and returns a real-number value for any comparison that has to be made, min(x_1, x_2, ...) returns the value determined by min(x_1) = x_1, - and succesively for later arguments, by the use of the equivalent of + and successively for later arguments, by the use of the equivalent of min(a,b) = (a < b) ? a : b. If the ordering determined by < is total, min(x_1, ...) will be the minimum value among the arguments. For a - preorder relation it may be one of several minimal values. For other + pre-order relation it may be one of several minimal values. For other relations, it may be difficult to predict the result. EXAMPLE diff --git a/help/mne b/help/mne index 444b70f..3724803 100644 --- a/help/mne +++ b/help/mne @@ -1,5 +1,5 @@ NAME - mne - test for inequality of real numbers modulo a specifed number + mne - test for inequality of real numbers modulo a specified number SYNOPSIS mne(x, y, md) diff --git a/help/operator b/help/operator index a73d1f4..39e13f0 100644 --- a/help/operator +++ b/help/operator @@ -12,7 +12,7 @@ operators binding. Except where otherwise indicated, operators at the same level of precedence associate from left to right. - Unlike C, calc has a definite order for evaluation of terms (addends + Unlike C, calc has a definite order for evaluation of terms (adds in a sum, factors in a product, arguments for a function or a matrix, etc.). This order is always from left to right. but skipping of terms may occur for ||, && and ? : . For example, diff --git a/help/overview b/help/overview index 729f429..e818b94 100644 --- a/help/overview +++ b/help/overview @@ -65,7 +65,7 @@ help unexpected It contains information about differences between C and calc - that may surprize you. + that may surprise you. To learn about calc standard resource files, try: diff --git a/help/pound b/help/pound index 8526efd..25c51c3 100644 --- a/help/pound +++ b/help/pound @@ -10,13 +10,13 @@ SYNOPSIS TYPES x, y integer or real - return integer (uniary operator case) + return integer (unary operator case) integer or real (binary operator case) DESCRIPTION The pound sign or sharp sign "#" has special meaning in calc. - As a uniary operator: + As a unary operator: # value diff --git a/help/printf b/help/printf index e3dd417..a18af39 100644 --- a/help/printf +++ b/help/printf @@ -14,7 +14,7 @@ DESCRIPTION The function printf() is similar to the C function with the same name. The most significant difference is that there is no requirement that the types of values of the arguments x_i match the - corresponding format specifier in fmt. Thus, whatver the + corresponding format specifier in fmt. Thus, whatever the format specifier, a number is printed as a number, a string as a string, a list as a list, a matrix as a matrix, an xx-object as an xx-object, etc. @@ -26,7 +26,7 @@ DESCRIPTION an optional '-' zero or more decimal digits - an optional '. followed by zero or more decimal deigits + an optional '. followed by zero or more decimal digits an optional 'l' one of the letters: d, s, c, f, e, g, r, o, x, b, diff --git a/help/protect b/help/protect index e146730..fb99b12 100644 --- a/help/protect +++ b/help/protect @@ -36,7 +36,7 @@ DESCRIPTION where V is an lvalue. Attempting either of these assignments will return an error value and leave the value of A or V unchanged. - Initally, when created, any lvalue A has zero status corresponding + Initially, when created, any lvalue A has zero status corresponding to "no protection". This may be restored at any time by protect(A, 0). If N is positive and A does not already have the protection @@ -64,7 +64,7 @@ DESCRIPTION X[2][0] and X[2][1] have depth 2; X[2][0].x, X[2][0].y, X[2][1].x and X[2][1].y have depth 3. For any lvalue A, protect(A, N, depth) applies protect(A, N) to A and to all elements, elements of - elements, etc., up tothe stated depth. In the above example, + elements, etc., up to the stated depth. In the above example, protect(X, 20, 2) gives no-type-change and no-copy-to protection to 8 of the listed lvalues, but not to the components of the objects X[2][0] and X[2][1]; With any d >= 3, protect(X, 20, d) @@ -73,7 +73,7 @@ DESCRIPTION If B is a variable with positive status and assignment of B to A is permitted, execution of the assignment A = B adds to the protections of A all protections of B that A does not already have. Except when - the value returned is the result of the evqluation of an lvalue with + the value returned is the result of the evaluation of an lvalue with positive status, calc's builtin operators and functions return values with zero protection status. For example, whatever the protection statuses of X and Y, X + sqrt(Y) will have zero status, but @@ -97,7 +97,7 @@ DESCRIPTION gives no-assign-to protection to the variable; i.e. noassignto(`A) achieves the same as protect(A,1). - In the brief descriptions above of builtin kinds of protectiopn, + In the brief descriptions above of builtin kinds of protection, "assign" refers to use of '=' as in A = expr to assign the value of expr to A, and in A = {..., expr, ...} to assign the value of expr to some component of A, and to the assignments implicit in @@ -110,7 +110,7 @@ DESCRIPTION "Copying" refers to initialization using {...} and to the operations copy and blkcpy as applied to strings, blocks, lists and matrices. Although A = {..., expr, ...) assigns the value of expr to an - elment of A, it is also regarded as copying to A. Thus, initialization + element of A, it is also regarded as copying to A. Thus, initialization of A may be prevented either by giving no-copy-to protection to A or no-assignment=to protection to the elements of A. Assignments to and from characters or octets in strings or blocks are also regarded as @@ -151,12 +151,12 @@ DESCRIPTION Although M = mat[2] = {...} and mat M[2] = {...} do the same thing, these are different from (M = mat[2]) = {...} and (mat M[3]) = {...}. In the former pair of statements, the result of mat[2] = {...} is being - assigned to M. In the latter statments, a matrix with zero elements is + assigned to M. In the latter statements, a matrix with zero elements is being assigned to M and then that matrix is being "reinitialized". Both - will fail if M has no-asssign-to protection, but only the latter + will fail if M has no-assign-to protection, but only the latter would be prevented by M having no-copy-to protection. - When the functions which mave move elements like of sort, reverse, + When the functions which can move elements like of sort, reverse, swap, insert, pop, remove, push and append. are evaluated, the protection statuses move with the values, e.g. if among the values and elements involved, there is just one with value 42, then the diff --git a/help/ptest b/help/ptest index e2e3e67..c4e91ee 100644 --- a/help/ptest +++ b/help/ptest @@ -40,12 +40,12 @@ DESCRIPTION is sufficient to consider 1 < b < n - 1. Note that if ptest returns 1, this does not mean that n is - prime! If n is composit (not prime) and a pseudoprime then + prime! If n is composite (not prime) and a pseudoprime then ptest may return 1. For this reason, if ptest returns 1, this is not proof that n is prime. If ptest returns 0, then this is proof that n is not prime - (composit). + (composite). The bases for ptest(n, count, skip) are selected as follows: diff --git a/help/quomod b/help/quomod index 7bd2a6d..95d6489 100644 --- a/help/quomod +++ b/help/quomod @@ -20,13 +20,13 @@ DESCRIPTION If y is zero, zero is assigned to Q, x to R and 0 or 1 returned according as x is zero or nonzero. - In the remaining case, y nonzero and x/y not an intger, there + In the remaining case, y nonzero and x/y not an integer, there are two pairs (q,r) for which x = q * y + r, q is an integer, and abs(r) < abs(y). Depending on the low 5 bits of rnd, the q and r of one of these pairs will be assigned to Q and R respectively, and the number 1 returned. The effects of rnd can be described in terms of the way q is related to x/y, e.g. by rounding down, - rounding towards zero, rounding to a nearest integeri, etc. or + rounding towards zero, rounding to a nearest integer, etc. or by properties of the remainder r, e.g. positive, negative, smallest, etc. The effects of the most commonly used values of rnd are described in the following table: @@ -36,7 +36,7 @@ DESCRIPTION 0 round down. q = floor(x/y) same sign as y 1 round up, q = ceil(x/y) opposite sign to y 2 round to zero, q = int(x/y) same sign as x, r = y * frac(x/y) - 3 round from zero oppsite sign to x + 3 round from zero opposite sign to x 4 positive 5 negative 6 same sign as x/y @@ -49,7 +49,7 @@ DESCRIPTION is the smallest (in absolute value) remainder except when x/y is halfway between consecutive integers, in which case the rounding is as given by the 4 low bits of rnd. Using rnd = 24 gives the - cpmmonly used principle of rounding: round to the nearest integer, + commonly used principle of rounding: round to the nearest integer, but take the even integer when there are two equally close integers. For more detail on the effects of rnd for values other than those @@ -66,7 +66,7 @@ DESCRIPTION An error values is returned and the values of Q and R are not changed if Q and R are not both lvalues, or if the current value of any argument is not as specified above, or if Q or R has no-assign-to - prptection, e.g. after protect(Q,1). + protection, e.g. after protect(Q,1). EXAMPLE diff --git a/help/rand b/help/rand index 870c4f7..74a3341 100644 --- a/help/rand +++ b/help/rand @@ -197,7 +197,7 @@ DESCRIPTION The truly paranoid might suggest that my claims in the MAGIC NUMBERS section are a lie intended to entrap people. Well they are not, but - if you that paranoid why would you use a non-cryprographically strong + if you that paranoid why would you use a non-cryptographically strong pseudo-random number generator in the first place? You would be better off using the random() builtin function. diff --git a/help/rsearch b/help/rsearch index 6feb786..29db51c 100644 --- a/help/rsearch +++ b/help/rsearch @@ -14,7 +14,7 @@ TYPES DESCRIPTION - Negative values of c and nonpositive values of d are treated as + Negative values of c and non-positive values of d are treated as offsets from size(a), i.e. as if c were replaced by size(a) + c and d by size(a) + d. Any such adjustment is assumed to have been made. diff --git a/help/script b/help/script index 2379e1e..344019c 100644 --- a/help/script +++ b/help/script @@ -48,7 +48,7 @@ Calc shell scripts ( ... ) for shell-function arguments, { ... } for brace expansion, $ for parameter or variable expansion, <, <<, >, >> for redirection of input or output, etc.) it will usually be - necessary to quote or escape tho characters, or usually more + necessary to quote or escape th characters, or usually more conveniently, quote whole expressions with single or double quotes. @@ -132,7 +132,7 @@ Calc shell scripts ./addall2 2 3 4 - the $* in ths script expands to 2 3 4, and because of the "-s" + the $* in this script expands to 2 3 4, and because of the "-s" in the options, calc starts with argv(0) = "2", argv(1) = "3", argv(2)= "4". As there is only one calc process involved and the eval() function accepts as argument any string that @@ -156,7 +156,7 @@ Calc shell scripts IMPORTANT NOTE: The -f flag must be at the very end of the #! line. - The #! line must be the first line of the exeuctable file. + The #! line must be the first line of the executable file. The path after the #! must be the full path to the calc executable. After the command: diff --git a/help/search b/help/search index 6be36a1..08a1709 100644 --- a/help/search +++ b/help/search @@ -14,7 +14,7 @@ TYPES DESCRIPTION - Negative values of c and nonpositive values for d are treated as + Negative values of c and non-positive values for d are treated as offsets from size(a), i.e. as if c were replaced by size(a) + c, and d by size(a) + d. Any such adjustment is assumed in the following description. diff --git a/help/sha1 b/help/sha1 index a871178..ec52cc3 100644 --- a/help/sha1 +++ b/help/sha1 @@ -25,7 +25,7 @@ DESCRIPTION The new arg1 HASH state is returned. If arg1 is not a a HASH state, then the initial HASH is - used and modifed by arg1 and any val args supplied. The + used and modified by arg1 and any val args supplied. The return value is the new HASH state. The following table gives a summary of actions and return values. @@ -60,7 +60,7 @@ EXAMPLE ; sha1("x", "y", "z") == sha1("xy") 0 - ; sha1(sha1("this is", 7^19-8, "a composit", 3i+4.5, "hash")) + ; sha1(sha1("this is", 7^19-8, "a composite", 3i+4.5, "hash")) 0xc3e1b562bf45b3bcfc055ac65b5b39cdeb6a6c55 ; x = sha1(list(1,2,3), "curds and whey", 2^21701-1, pi()) diff --git a/help/size b/help/size index e069999..25e82b9 100644 --- a/help/size +++ b/help/size @@ -15,7 +15,7 @@ DESCRIPTION null 0 real number 1 complex number 1 - string length of string (not counding the trailing \0) + string length of string (not including the trailing \0) matrix number of elements list number of members association number of (elements, value) pairs @@ -25,9 +25,9 @@ DESCRIPTION random state 1 config state 1 hash state 1 - block numer of octets of data it currently holds + block number of octets of data it currently holds octet 1 - named block numer of octets of data it currently holds + named block number of octets of data it currently holds EXAMPLE ; print size(null()), size(3), size(2 - 7i), size("abc") diff --git a/help/sizeof b/help/sizeof index 0523ba8..d153929 100644 --- a/help/sizeof +++ b/help/sizeof @@ -15,10 +15,10 @@ DESCRIPTION a value and all of its components. Unlike memsize(x), this builtin does not include the size of the overhead. - Unlike size(x), this builtin incldues the trailing \0 byte on the + Unlike size(x), this builtin includes the trailing \0 byte on the end of strings. - For numeric values, sizeof(x) ignores the demoninator if 'x' is + For numeric values, sizeof(x) ignores the denominator if 'x' is an integer. For complex values, sizeof(x) ignores the imaginary part if 'x' is real. Because the 0, 1 and -1 numeric values are shared static values, sizeof(x) reports such values as having diff --git a/help/sort b/help/sort index 498d8b2..11a2b08 100644 --- a/help/sort +++ b/help/sort @@ -56,7 +56,7 @@ DESCRIPTION precede b, while precedes(a,b) being zero intends that the order of a and b is to be as in the original x. For any integer-valued precedes() function, the algorithm will return a result for sort(x), - but to guarantee fulfilment of the intentions just described, + but to guarantee fulfillment of the intentions just described, precedes() should satisfy the conditions: (1) For all a, b, c, precedes(a,b) implies precedes(a,c) || precedes (c,b), @@ -159,7 +159,7 @@ DESCRIPTION Examples of effects of various precedes functions for sorting lists of integers: - a > b Sorts into nonincreasing order. + a > b Sorts into non-increasing order. abs(a) < abs(b) Sorts into nondecreasing order of absolute values, numbers with the diff --git a/help/srandom b/help/srandom index defce60..2ea9f84 100644 --- a/help/srandom +++ b/help/srandom @@ -267,7 +267,7 @@ DESCRIPTION speed relative the default Blum generator. As of Feb 1997, the Blum moduli associated with 13 <= newn < 20 appear to be well beyond the scope of hardware and algorithms, - and 9 <= newn < 12 might be factorable with extreme difficulty. + and 9 <= newn < 12 might be factor-able with extreme difficulty. The following table may be useful as a guide for how easy it is to factor the modulus: diff --git a/help/strncpy b/help/strncpy index b6a497c..7ed3527 100644 --- a/help/strncpy +++ b/help/strncpy @@ -1,5 +1,5 @@ NAME - strncpy - copy a number of chracters from head or all of a stringr + strncpy - copy a number of characters from head or all of a string to head or all of a string SYNOPSIS diff --git a/help/strpos b/help/strpos index 74ebf6b..98486c3 100644 --- a/help/strpos +++ b/help/strpos @@ -11,7 +11,7 @@ TYPES return int DESCRIPTION - This function returns the location of the first occurance of the string t + This function returns the location of the first occurrence of the string t in the string s. If t is not found within s, 0 is returned. If t is found at the beginning of s, 1 is returned. diff --git a/help/strtolower b/help/strtolower index 4721dcf..0d631c4 100644 --- a/help/strtolower +++ b/help/strtolower @@ -14,7 +14,7 @@ DESCRIPTION All ASCII upper case letters get transformed into lower case letters. This function can be locale dependent. - The function returns the lowercase'd string. + The function returns the lowercased string. EXAMPLE ; strtolower(" GNU Lesser General Public License"); diff --git a/help/strtoupper b/help/strtoupper index 7891a79..5170fa7 100644 --- a/help/strtoupper +++ b/help/strtoupper @@ -14,7 +14,7 @@ DESCRIPTION All ASCII lower case letters get transformed into upper case letters. This function can be locale dependent. - The function returns the lowercase'd string. + The function returns the lowercased string. EXAMPLE ; strtoupper(" GNU Lesser General Public License"); diff --git a/help/sum b/help/sum index 1024e32..6145c26 100644 --- a/help/sum +++ b/help/sum @@ -12,7 +12,7 @@ TYPES DESCRIPTION If an argument x_i is a list with elements e_1, e_2, ..., e_n, it is treated as if x_i were replaced by e_1, e_2, ..., e_n; this may - continue recurively if any of the e_j is a list. + continue recursively if any of the e_j is a list. If an argument x_i is an object of type xx, then x_i is replaced by xx_sum(x_i) if the function xx_sum() has been defined. If the diff --git a/help/system b/help/system index 4333903..5598ec9 100644 --- a/help/system +++ b/help/system @@ -10,7 +10,7 @@ TYPES return int DESCRIPTION - This function excutes the shell command found in the srtring, cmd. + This function executes the shell command found in the string, cmd. The return value is system dependent. On POSIX P1003.1 compliant systems the return value is defined by the waitpid system call. Typically a shell command that returns with a 0 exit status will diff --git a/help/time b/help/time index 69eded6..164fd86 100644 --- a/help/time +++ b/help/time @@ -9,7 +9,7 @@ TYPES DESCRIPTION The time() builtin returns the number of seconds since the Epoch, - which according to Posix is: + which according to POSIX is: Thr Jan 1 00:00:00 UTC 1970 diff --git a/help/trunc b/help/trunc index 2474f32..6418b76 100644 --- a/help/trunc +++ b/help/trunc @@ -14,7 +14,7 @@ DESCRIPTION Truncate x to j decimal places. If j is omitted, 0 places is assumed. Specifying zero places makes the result identical to int(). - Truncation of a non-integer prodcues values nearer to zero. + Truncation of a non-integer produces values nearer to zero. EXAMPLE ; print trunc(pi()), trunc(pi(), 5) diff --git a/help/unexpected b/help/unexpected index 49cd566..7c955e3 100644 --- a/help/unexpected +++ b/help/unexpected @@ -185,7 +185,7 @@ Unexpected calc always evaluates terms from left to right ============================================== - Calc has a definite order for evaluation of terms (addends in a + Calc has a definite order for evaluation of terms (adds in a sum, factors in a product, arguments for a function or a matrix, etc.). This order is always from left to right. but skipping of terms may occur for ||, && and ? : . diff --git a/help/version b/help/version index 36beaf3..ca0307a 100644 --- a/help/version +++ b/help/version @@ -17,7 +17,7 @@ DESCRIPTION x.y where x, y, z, w, v are integers (without leading 0's) and, - t is the liternal character 't'. + t is the literal character 't'. EXAMPLE ; version() diff --git a/help/wishlist b/help/wishlist index 3a86988..9421e67 100644 --- a/help/wishlist +++ b/help/wishlist @@ -18,6 +18,8 @@ Please read CONTRIB-CODE or run the following calc command: become known. In particular, look at better algorithms for very large numbers -- multiply, square and mod in particular. + * Correct typos in text and code comments. + * Implement an autoload feature. Associate a calc resource filename with a function or global variable. On the first reference of such item, perform an automatic load of that file. @@ -69,7 +71,7 @@ Please read CONTRIB-CODE or run the following calc command: If you have a command that takes a very long time to execute, it would be nice if you could get at its result without having - to spend the time to reexecute it. + to spend the time to re-execute it. * Add a binding to delete a value from the history list. diff --git a/hist.c b/hist.c index 1ca5c7b..08376c6 100644 --- a/hist.c +++ b/hist.c @@ -403,7 +403,7 @@ hist_term(void) hist_last = NULL; /* - * restore orignal tty state + * restore original tty state */ (void) orig_tty(STDIN); } diff --git a/hist.h b/hist.h index 68eabdf..18d603f 100644 --- a/hist.h +++ b/hist.h @@ -58,7 +58,7 @@ * not prevent calling the other routines, but fancy command line editing * is then disabled. */ -#define HIST_SUCCESS 0 /* successfully inited */ +#define HIST_SUCCESS 0 /* successfully initialized */ #define HIST_INITED 1 /* initialization is already done */ #define HIST_NOFILE 2 /* bindings file could not be read */ #define HIST_NOTTY 3 /* terminal modes could not be set */ diff --git a/lib_util.c b/lib_util.c index 2b48547..c2127e6 100644 --- a/lib_util.c +++ b/lib_util.c @@ -141,7 +141,7 @@ convstr2z(char *str) } /* - * allocate HALF strorage + * allocate HALF storage */ len = (strlen(str)+sizeof(HALF)-1)/sizeof(HALF); v = (HALF *)malloc(len * sizeof(HALF)); @@ -211,7 +211,7 @@ convhex2z(char *hex) } /* - * allocate HALF strorage + * allocate HALF storage */ slen = strlen(hex); len = ((slen*4)+BASEB-1)/BASEB; diff --git a/matfunc.c b/matfunc.c index 6f49e9e..a18d0fa 100644 --- a/matfunc.c +++ b/matfunc.c @@ -774,7 +774,7 @@ matbround(MATRIX *m, VALUE *v2, VALUE *v3) } /* - * Approximate a matrix by approximating elemenbs to be multiples of + * Approximate a matrix by approximating elements to be multiples of * v2, rounding type determined by v3. */ MATRIX * @@ -1455,7 +1455,7 @@ matinit(MATRIX *m, VALUE *v1, VALUE *v2) } /* - * fill the diaginal of a square matrix if requested + * fill the diagonal of a square matrix if requested */ rows = res->m_max[0] - res->m_min[0] + 1; v = res->m_table; @@ -1786,7 +1786,7 @@ matprint(MATRIX *m, long max_print) /* * Now print the first few elements of the matrix in short - * and unambigous format. + * and unambiguous format. */ math_str(":\n"); vp = m->m_table; diff --git a/math_error.c b/math_error.c index b829dd7..b67d3c3 100644 --- a/math_error.c +++ b/math_error.c @@ -35,7 +35,7 @@ * If one sets up calc_matherr_jmpbuf, and then sets calc_use_matherr_jmpbuf * to non-zero then this routine will longjmp back with the return value of * calc_use_matherr_jmpbuf. In addition, the last calc error message will be - * found in calc_use_matherr_jmpbuf_msg. This error is not printed to sttderr. + * found in calc_use_matherr_jmpbuf_msg. This error is not printed to stderr. * * For example: * diff --git a/opcodes.h b/opcodes.h index 8a857f4..681d1de 100644 --- a/opcodes.h +++ b/opcodes.h @@ -41,10 +41,10 @@ #define OP_NOP 0L /* no operation */ #define OP_LOCALADDR 1L /* load address of local variable */ #define OP_GLOBALADDR 2L /* load address of global variable */ -#define OP_PARAMADDR 3L /* load address of paramater variable */ +#define OP_PARAMADDR 3L /* load address of parameter variable */ #define OP_LOCALVALUE 4L /* load value of local variable */ #define OP_GLOBALVALUE 5L /* load value of global variable */ -#define OP_PARAMVALUE 6L /* load value of paramater variable */ +#define OP_PARAMVALUE 6L /* load value of parameter variable */ #define OP_NUMBER 7L /* load constant real numeric value */ #define OP_INDEXADDR 8L /* load array index address */ #define OP_PRINTRESULT 9L /* print result of top-level expression */ diff --git a/prime.h b/prime.h index c550969..5f827c4 100644 --- a/prime.h +++ b/prime.h @@ -38,10 +38,10 @@ #endif -#define MAX_MAP_PRIME ((FULL)65521) /* (2^16-15) larest prime in prmap */ -#define MAX_MAP_VAL ((FULL)65535) /* (2^16-1) larest bit in pr_map */ -#define MAX_SM_PRIME ((FULL)0xfffffffb) /* (2^32-5) larest 32 bit prime */ -#define MAX_SM_VAL ((FULL)0xffffffff) /* (2^32-1) larest 32 bit value */ +#define MAX_MAP_PRIME ((FULL)65521) /* (2^16-15) largest prime in prmap */ +#define MAX_MAP_VAL ((FULL)65535) /* (2^16-1) largest bit in pr_map */ +#define MAX_SM_PRIME ((FULL)0xfffffffb) /* (2^32-5) largest 32 bit prime */ +#define MAX_SM_VAL ((FULL)0xffffffff) /* (2^32-1) largest 32 bit value */ #define MAP_POPCNT 6541 /* number of odd primes in pr_map */ @@ -70,7 +70,7 @@ /* * Limits for piXb tables. Do not test about this value using the - * given table, even though the table has a higher sentinal value. + * given table, even though the table has a higher sentinel value. */ #define MAX_PI10B ((1024*256)-1) /* largest pi10b value to test */ #define MAX_PI18B ((FULL)(0xFFFFFFFF)) /* largest pi18b value to test */ diff --git a/qfunc.c b/qfunc.c index c128a42..6bd6e4e 100644 --- a/qfunc.c +++ b/qfunc.c @@ -626,7 +626,7 @@ qilog(NUMBER *q, ZVALUE base) * * digits(12.3456) == 2 computes with the integer part only * digits(-1234) == 4 computes with the absolute value only - * digits(0) == 1 specical case + * digits(0) == 1 special case * digits(-0.123) == 1 combination of all of the above * * given: @@ -1315,7 +1315,7 @@ qmappr(NUMBER *q, NUMBER *e, long rnd) /* * Determine the smallest-denominator rational number in the interval of - * length abs(epsilon) (< 1) with centre or one end at q, or to determine + * length abs(epsilon) (< 1) with center or one end at q, or to determine * the number nearest above or nearest below q with denominator * not exceeding abs(epsilon). * Whether the approximation is nearest above or nearest below is diff --git a/qmath.c b/qmath.c index 60369fe..3829abf 100644 --- a/qmath.c +++ b/qmath.c @@ -1092,7 +1092,7 @@ qxor(NUMBER *q1, NUMBER *q2) /* - * Perform the bitwise ANDNOT of two integers. + * Perform the bitwise AND-NOT of two integers. */ NUMBER * qandnot(NUMBER *q1, NUMBER *q2) diff --git a/qtrans.c b/qtrans.c index e3a1086..7ba2f2f 100644 --- a/qtrans.c +++ b/qtrans.c @@ -77,7 +77,7 @@ qsincos(NUMBER *q, long bitnum, NUMBER **vs, NUMBER **vc) s++; if (s < -h) s = -h; - n = h + s; /* n is number of squarings that will be required */ + n = h + s; /* n is number of squaring that will be required */ m = bitnum + n; while (s > 0) { /* increasing m by ilog2(s) */ s >>= 1; @@ -1059,7 +1059,7 @@ qlog(NUMBER *q, NUMBER *epsilon) /* first time call */ ln_10_epsilon = qcopy(epsilon); } else if (qcmp(ln_10_epsilon, epsilon) == TRUE) { - /* replaced cacheed value with epsilon arg */ + /* replaced cached value with epsilon arg */ qfree(ln_10_epsilon); ln_10_epsilon = qcopy(epsilon); } else if (ln_10 != NULL) { diff --git a/quickhash.c b/quickhash.c index 72b9704..aa43a1c 100644 --- a/quickhash.c +++ b/quickhash.c @@ -76,7 +76,7 @@ S_FUNC QCKHASH blk_hash(BLOCK *blk, QCKHASH val); * and found that it worked rather well. In an Email message * to Landon, they named it ``Fowler/Noll/Vo'' or the FNV hash. * - * FNV hashes are architected to be fast while maintaining a low + * FNV hashes are designed to be fast while maintaining a low * collision rate. The FNV speed allows one to quickly hash lots * of data while maintaining a reasonable collision rate. See: * @@ -120,7 +120,7 @@ S_FUNC QCKHASH blk_hash(BLOCK *blk, QCKHASH val); * The core of the of the FNV hash has been adopted as the calc * quick hash with the provision that it operates on 32 bit * objects instead of octets. For calc's internal purposes, - * this is sufficent. For general FNV hashing, this is not + * this is sufficient. For general FNV hashing, this is not * recommended. * * It has been observed that gcc, when using -O, -O2, -O3 or @@ -425,7 +425,7 @@ config_hash(CONFIG *cfg, QCKHASH val) value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outmode); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outmode2); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outdigits); - /* epsilon is handeled out of order */ + /* epsilon is handled out of order */ value = (((value>>5) | (value<<27)) ^ (USB32)cfg->epsilonprec); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->traceflags); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->maxprint); @@ -447,8 +447,8 @@ config_hash(CONFIG *cfg, QCKHASH val) value = (((value>>5) | (value<<27)) ^ (USB32)cfg->leadzero); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->fullzero); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->maxscancount); - /* prompt1 is handeled out of order */ - /* prompt2 is handeled out of order */ + /* prompt1 is handled out of order */ + /* prompt2 is handled out of order */ value = (((value>>5) | (value<<27)) ^ (USB32)cfg->blkmaxprint); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->blkverbose); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->blkbase); @@ -458,8 +458,8 @@ config_hash(CONFIG *cfg, QCKHASH val) value = (((value>>5) | (value<<27)) ^ (USB32)cfg->user_debug); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->verbose_quit); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->ctrl_d); - /* program is handeled out of order */ - /* basename is handeled out of order */ + /* program is handled out of order */ + /* basename is handled out of order */ value = (((value>>5) | (value<<27)) ^ (USB32)cfg->windows); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->cygwin); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->compile_custom); @@ -468,7 +468,7 @@ config_hash(CONFIG *cfg, QCKHASH val) } else { value = (((value>>5) | (value<<27)) ^ (USB32)FALSE); } - /* version is handeled out of order */ + /* version is handled out of order */ /* * hash the built up scalar diff --git a/seed.c b/seed.c index c9c4653..d13083b 100644 --- a/seed.c +++ b/seed.c @@ -194,7 +194,7 @@ prvate_hash64_buf(char *buf, unsigned len) * and found that it worked rather well. In an Email message * to Landon, they named it ``Fowler/Noll/Vo'' or the FNV hash. * - * FNV hashes are architected to be fast while maintaining a low + * FNV hashes are designed to be fast while maintaining a low * collision rate. The FNV speed allows one to quickly hash lots * of data while maintaining a reasonable collision rate. See: * @@ -242,7 +242,7 @@ prvate_hash64_buf(char *buf, unsigned len) /* multiply by the other non-zero digit */ tmp[2] += val[0] << 8; /* tmp[2] += val[0] * 0x100 */ tmp[3] += val[1] << 8; /* tmp[1] += val[1] * 0x100 */ - /* proapage carries */ + /* propagate carries */ tmp[1] += (tmp[0] >> 16); val[0] = tmp[0] & 0xffff; tmp[2] += (tmp[1] >> 16); diff --git a/sha1.c b/sha1.c index 10dbcd2..f4f96f9 100644 --- a/sha1.c +++ b/sha1.c @@ -126,7 +126,7 @@ sha1Init(HASH *state) dig->digest[3] = h3init; dig->digest[4] = h4init; - /* Initialise bit count */ + /* Initialize bit count */ dig->countLo = 0; dig->countHi = 0; dig->datalen = 0; @@ -134,10 +134,10 @@ sha1Init(HASH *state) /* - * sha1Transform - perform the SHA1 transformatio + * sha1Transform - perform the SHA1 transformation * * Note that this code, like MD5, seems to break some optimizing compilers. - * It may be necessary to split it into sections, eg based on the four + * It may be necessary to split it into sections, e.g., based on the four * subrounds. One may also want to roll each subround into a loop. */ S_FUNC void @@ -153,7 +153,7 @@ sha1Transform(USB32 *digest, USB32 *W) D = digest[3]; E = digest[4]; - /* Heavy mangling, in 4 sub-rounds of 20 interations each. */ + /* Heavy mangling, in 4 sub-rounds of 20 iterations each. */ subRound(A, B, C, D, E, f1, K1, W[ 0]); subRound(E, A, B, C, D, f1, K1, W[ 1]); subRound(D, E, A, B, C, f1, K1, W[ 2]); @@ -512,7 +512,7 @@ void sha1_init_state(HASH *state) { /* - * initalize state + * initialize state */ state->hashtype = SHA1_HASH_TYPE; state->bytes = TRUE; diff --git a/size.c b/size.c index c52f0cb..0534a88 100644 --- a/size.c +++ b/size.c @@ -110,7 +110,7 @@ elm_count(VALUE *vp) /* - * zsize - calculate memory footprint of a ZVALUE (exlcuding overhead) + * zsize - calculate memory footprint of a ZVALUE (excluding overhead) * * The numeric -1, - and 1 storage values are ignored. * @@ -133,7 +133,7 @@ zsize(ZVALUE z) /* - * qsize - calculate memory footprint of a NUMBER (exlcuding overhead) + * qsize - calculate memory footprint of a NUMBER (excluding overhead) * * The numeric -1, - and 1 storage values are ignored. Denominator * parts of integers are ignored. @@ -147,7 +147,7 @@ zsize(ZVALUE z) S_FUNC size_t qsize(NUMBER *q) { - /* ingore denominator parts of integers */ + /* ignore denominator parts of integers */ if (qisint(q)) { return zsize(q->num); } else { @@ -157,7 +157,7 @@ qsize(NUMBER *q) /* - * csize - calculate memory footprint of a COMPLEX (exlcuding overhead) + * csize - calculate memory footprint of a COMPLEX (excluding overhead) * * The numeric -1, - and 1 storage values are ignored. Denominator * parts of integers are ignored. Imaginary parts of pure reals @@ -172,7 +172,7 @@ qsize(NUMBER *q) S_FUNC size_t csize(COMPLEX *c) { - /* ingore denominator parts of integers */ + /* ignore denominator parts of integers */ if (cisreal(c)) { return qsize(c->real); } else { diff --git a/str.c b/str.c index 52b3faf..9cb0f7a 100644 --- a/str.c +++ b/str.c @@ -78,7 +78,7 @@ initstr(STRINGHEAD *hp) * Copy a string to the end of a list of strings, and return the address * of the copied string. Returns NULL if the string could not be copied. * No checks are made to see if the string is already in the list. - * The string cannot be null or have imbedded nulls. + * The string cannot be null or have embedded nulls. * * given: * hp header of string storage @@ -1230,7 +1230,7 @@ STRING * slink(STRING *s) { if (s->s_links <= 0) { - math_error("Argument for slink has nonpositive links!!!"); + math_error("Argument for slink has non-positive links!!!"); /*NOTREACHED*/ } ++s->s_links; @@ -1242,7 +1242,7 @@ void sfree(STRING *s) { if (s->s_links <= 0) { - math_error("Argument for sfree has nonpositive links!!!"); + math_error("Argument for sfree has non-positive links!!!"); /*NOTREACHED*/ } if (--s->s_links > 0 || s->s_len == 0) diff --git a/token.c b/token.c index 97472b7..fedee85 100644 --- a/token.c +++ b/token.c @@ -710,7 +710,7 @@ scanerror(int skip, char *fmt, ...) { va_list ap; char *name; /* name of file with error */ - int len; /* length of error msg bufer */ + int len; /* length of error msg buffer */ /* count the error */ errorcount++; @@ -815,7 +815,7 @@ warning(char *fmt, ...) { va_list ap; char *name; /* name of file with error */ - int len; /* length of error msg bufer */ + int len; /* length of error msg buffer */ /* count this warning */ ++calc_warn_cnt; diff --git a/value.c b/value.c index c8a8ffe..dd0fbee 100644 --- a/value.c +++ b/value.c @@ -1983,7 +1983,7 @@ powvalue(VALUE *v1, VALUE *v2, VALUE *vres) } break; - /* unspported exponent type */ + /* unsupported exponent type */ default: *vres = error_value(E_POWI2); break; @@ -1995,7 +1995,7 @@ powvalue(VALUE *v1, VALUE *v2, VALUE *vres) /* * Raise one value to another value's power, within the specified error. * Result is placed in the indicated location. If v3 is NULL, the - * value conf->epsiilon is used. + * value conf->epsilon is used. */ void powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) @@ -2017,7 +2017,7 @@ powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) return; } - /* NULL epsilon means use built-in epslion value */ + /* NULL epsilon means use built-in epsilon value */ if (v3 == NULL) { epsilon = conf->epsilon; } else { diff --git a/zfunc.c b/zfunc.c index 28722d3..3fd7cca 100644 --- a/zfunc.c +++ b/zfunc.c @@ -377,7 +377,7 @@ zcomb(ZVALUE z1, ZVALUE z2, ZVALUE *res) * the result is 1 if m == x^2 (mod n) for some x. * otherwise the result is -1. * - * If n is not prime, then the result does not prove that n is not prine + * If n is not prime, then the result does not prove that n is not prime * when the value of the Jacobi is 1. * * Jacobi evaluation of (m / n), where n > 0 is odd AND m > 0 is odd: @@ -456,7 +456,7 @@ zfib(ZVALUE z, ZVALUE *res) { long n; int sign; - ZVALUE fnm1, fn, fnp1; /* consecutive fibonacci values */ + ZVALUE fnm1, fn, fnp1; /* consecutive Fibonacci values */ ZVALUE t1, t2, t3; FULL i; diff --git a/zio.c b/zio.c index 5e2a92d..4be2f7b 100644 --- a/zio.c +++ b/zio.c @@ -66,7 +66,7 @@ STATIC size_t outbufused; /* - * zio_init - perform needed initilization work + * zio_init - perform needed initialization work * * On some systems, one cannot initialize a pointer to a FILE *. * This routine, called once at startup is a work-a-round for diff --git a/zmath.c b/zmath.c index 99babaa..826970c 100644 --- a/zmath.c +++ b/zmath.c @@ -1430,7 +1430,7 @@ zxor(ZVALUE z1, ZVALUE z2, ZVALUE *res) /* - * Compute the bitwise ANDNOT of two integers. + * Compute the bitwise AND NOT of two integers. */ void zandnot(ZVALUE z1, ZVALUE z2, ZVALUE *res) @@ -1597,7 +1597,7 @@ zhighbit(ZVALUE z) /* - * Return whether or not the specifed bit number is set in a number. + * Return whether or not the specified bit number is set in a number. * Rightmost bit of a number is bit 0. */ BOOL @@ -1669,7 +1669,7 @@ zisallbits(ZVALUE z) /* * Return the number whose binary representation contains only one bit which - * is in the specified position (counting from zero). This is equivilant + * is in the specified position (counting from zero). This is equivalent * to raising two to the given power. */ void diff --git a/zmath.h b/zmath.h index 475c956..92edd27 100644 --- a/zmath.h +++ b/zmath.h @@ -26,7 +26,7 @@ /* * Data structure declarations for extended precision integer arithmetic. * The assumption made is that a long is 32 bits and shorts are 16 bits, - * and longs must be addressible on word boundaries. + * and longs must be addressable on word boundaries. */ @@ -140,11 +140,11 @@ typedef SB32 SFULL; /* signed FULL */ */ typedef USB32 QCKHASH; /* 32 bit hash value */ #if defined(HAVE_B64) && LONG_BITS == 32 -typedef HALF PRINT; /* cast for zio printing fucctions */ +typedef HALF PRINT; /* cast for zio printing functions */ #define SWAP_B16_IN_PRINT(dest, src) SWAP_B16_IN_HALF(dest, src) #define SWAP_B8_IN_PRINT(dest, src) SWAP_B8_IN_HALF(dest, src) #else -typedef FULL PRINT; /* cast for zio printing fucctions */ +typedef FULL PRINT; /* cast for zio printing functions */ #define SWAP_B16_IN_PRINT(dest, src) SWAP_B16_IN_FULL(dest, src) #define SWAP_B8_IN_PRINT(dest, src) SWAP_B8_IN_FULL(dest, src) #endif @@ -474,7 +474,7 @@ E_FUNC void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); /* * Some algorithms testing for values of a certain length. Macros such as - * zistiny() do this well. In other cases algorthms require tests for values + * zistiny() do this well. In other cases algorithms require tests for values * in comparison to a given power of 2. In the later case, zistiny() compares * against a different power of 2 on a 64 bit machine. The macros below * provide a tests against powers of 2 that are independent of the work size. @@ -645,7 +645,7 @@ EXTERN BOOL _math_abort_; /* nonzero to abort calculations */ EXTERN ZVALUE _tenpowers_[]; /* table of 10^2^n */ /* - * Bit fiddeling functions and types + * Bit fiddling functions and types */ EXTERN HALF bitmask[]; /* bit rotation, norm 0 */ EXTERN HALF lowhalf[]; /* bit masks from low end of HALF */ diff --git a/zmod.c b/zmod.c index a5c55e9..34be1d1 100644 --- a/zmod.c +++ b/zmod.c @@ -916,7 +916,7 @@ zredcfree(REDC *rp) * The resulting number can be used for multiplying, adding, subtracting, * or comparing with any other such converted numbers, as if the numbers * were being calculated modulo the number which initialized the REDC - * information. When the final value is unconverted, the result is the + * information. When the final value is not converted, the result is the * same as if the usual operations were done with the original numbers. * * given: diff --git a/zmul.c b/zmul.c index ad42a8b..f6ffad1 100644 --- a/zmul.c +++ b/zmul.c @@ -99,7 +99,7 @@ zmul(ZVALUE z1, ZVALUE z2, ZVALUE *res) /* * Recursive routine to multiply two numbers by splitting them up into * two numbers of half the size, and using the results of multiplying the - * subpieces. The result is placed in the indicated array, which must be + * sub-pieces. The result is placed in the indicated array, which must be * large enough for the result plus one extra word (size1 + size2 + 1). * Returns the actual size of the result with leading zeroes stripped. * This also uses a temporary array which must be twice as large as @@ -140,7 +140,7 @@ domul(HALF *v1, LEN size1, HALF *v2, LEN size2, HALF *ans) FULL carryACBD; /* carry from addition of A*C and B*D */ FULL digit; /* single digit multiplying by */ HALF *temp; /* base for temporary calculations */ - BOOL neg; /* whether imtermediate term is negative */ + BOOL neg; /* whether intermediate term is negative */ register HALF *hd, *h1=NULL, *h2=NULL; /* for inner loops */ SIUNION sival; /* for addition of digits */ @@ -690,7 +690,7 @@ zsquare(ZVALUE z, ZVALUE *res) /* * Recursive routine to square a number by splitting it up into two numbers - * of half the size, and using the results of squaring the subpieces. + * of half the size, and using the results of squaring the sub-pieces. * The result is placed in the indicated array, which must be large * enough for the result (size * 2). Returns the size of the result. * This uses a temporary array which must be 3 times as large as the @@ -744,7 +744,7 @@ dosquare(HALF *vp, LEN size, HALF *ans) /* * If the number has only a small number of digits, then use the * (almost) normal multiplication method. Multiply each halfword - * only by those halfwards further on in the number. Missed terms + * only by those halfwords further on in the number. Missed terms * will then be the same pairs of products repeated, and the squares * of each halfword. The first case is handled by doubling the * result. The second case is handled explicitly. The number of diff --git a/zprime.c b/zprime.c index e7ed465..a659fa2 100644 --- a/zprime.c +++ b/zprime.c @@ -1577,8 +1577,8 @@ zlcmfact(ZVALUE z, ZVALUE *dest) * * We will determine the square root of a given value. * Starting with the integer square root of the largest power of - * two <= the value, we will perform 3 Newton interations to - * arive at our guess. + * two <= the value, we will perform 3 Newton iterations to + * arrive at our guess. * * We have verified that fsqrt(x) == (FULL)sqrt((double)x), or * fsqrt(x)-1 == (FULL)sqrt((double)x) for all 0 <= x < 2^32. @@ -1604,7 +1604,7 @@ fsqrt(FULL x) } y = isqrt_pow2[i + topbit[y]]; - /* perform 3 Newton interations */ + /* perform 3 Newton interactions */ y = (y+x/y)>>1; y = (y+x/y)>>1; y = (y+x/y)>>1; diff --git a/zrand.c b/zrand.c index ac9398f..c04eabb 100644 --- a/zrand.c +++ b/zrand.c @@ -280,7 +280,7 @@ * SOURCE OF MAGIC NUMBERS: * * Most of the magic constants used on this file ultimately are - * based on LavaRnd. LavaRnd produced them via a cryprographic + * based on LavaRnd. LavaRnd produced them via a cryptographic * of the digitization of chaotic system that consisted of a noisy * digital camera and 6 Lava Lite(R) lamps. * @@ -310,7 +310,7 @@ * * The truly paranoid might suggest that my claims in the MAGIC NUMBERS * section are a lie intended to entrap people. Well they are not, but - * if you that paranoid why would you use a non-cryprographically strong + * if you that paranoid why would you use a non-cryptographically strong * pseudo-random number generator in the first place? You would be * better off using the random() builtin function. * @@ -1343,7 +1343,7 @@ zsrand(CONST ZVALUE *pseed, CONST MATRIX *pmat100) printf("rand: skipped %d states\n", RAND_SKIP); } - /* no skip, just descrment use counter */ + /* no skip, just decrement use counter */ } else { --s100.need_to_skip; } @@ -1426,7 +1426,7 @@ zsetrand(CONST RAND *state) * When FULL_BITS is 64 the element is 1 FULL, otherwise FULL_BITS * is 32 bits and the element is 2 FULLs. The most significant bit * in the array (highest bit in the last FULL of the array) is to - * be transfered to the most significant bit in the destination. + * be transferred to the most significant bit in the destination. * * given: * bitstr - most significant destination bit in a bit string @@ -1434,15 +1434,15 @@ zsetrand(CONST RAND *state) * count - number of bits to transfer (must be 0 < count <= 64) * * returns: - * number of bits transfered + * number of bits transferred */ S_FUNC int slotcp(BITSTR *bitstr, FULL *src, int count) { HALF *dh; /* most significant HALF in dest */ - int dnxtbit; /* next bit beyond most signif in dh */ + int dnxtbit; /* next bit beyond most significant in dh */ int need; /* number of bits we need to transfer */ - int ret; /* bits transfered */ + int ret; /* bits transferred */ /* * determine how many bits we actually need to transfer @@ -1548,12 +1548,12 @@ slotcp(BITSTR *bitstr, FULL *src, int count) *dh |= (((HALF)src[0] & highhalf[dnxtbit+need]) << dnxtbit); #else if (need > BASEB) { - /* load the remaining bits from the most signif FULL */ + /* load the remaining bits from the most significant FULL */ *dh-- = ((((HALF)src[SLEN-1] & lowhalf[BASEB-dnxtbit]) << dnxtbit) | (HALF)(src[0] >> (FULL_BITS-dnxtbit))); need -= BASEB; } else if (need > 0) { - /* load the remaining bits from the most signif FULL */ + /* load the remaining bits from the most significant FULL */ *dh-- |= (((((HALF)src[SLEN-1] & lowhalf[BASEB-dnxtbit]) << dnxtbit) | (HALF)(src[0] >> (FULL_BITS-dnxtbit))) & highhalf[need]); @@ -1570,7 +1570,7 @@ slotcp(BITSTR *bitstr, FULL *src, int count) if (need > BASEB) { /* fill up the 2nd most significant HALF */ *dh-- = (HALF)(src[0] >> (BASEB-dnxtbit)); - /* no need todo: need -= BASEB, because we are nearly done */ + /* no need TODO: need -= BASEB, because we are nearly done */ } else if (need > 0) { /* we exhaust our need before 2nd half is filled */ *dh |= ((HALF)(src[0] >> (BASEB-dnxtbit)) & @@ -1602,20 +1602,20 @@ slotcp(BITSTR *bitstr, FULL *src, int count) * When FULL_BITS is 64 this array is 1 FULL, otherwise FULL_BITS * is 32 bits and the array is 2 FULLs. The most significant bit * in the array (highest bit in the last FULL of the array) is to - * be transfered to the most significant bit in the destination. + * be transferred to the most significant bit in the destination. * * given: * bitstr - most significant destination bit in a bit string * src - low order FULL in a 64 bit slot * * returns: - * number of bits transfered + * number of bits transferred */ S_FUNC void slotcp64(BITSTR *bitstr, FULL *src) { - HALF *dh = bitstr->loc; /* most significant HALF in dest */ - int dnxtbit = bitstr->bit+1; /* next bit beyond most signif in dh */ + HALF *dh = bitstr->loc; /* most significant HALF in dest */ + int dnxtbit = bitstr->bit+1; /* next dh bit beyond most significant */ /* * prepare for the return @@ -1663,7 +1663,7 @@ slotcp64(BITSTR *bitstr, FULL *src) #if FULL_BITS == SBITS *dh |= (((HALF)src[0] & lowhalf[BASEB-dnxtbit]) << dnxtbit); #else - /* load the remaining bits from the most signif FULL */ + /* load the remaining bits from the most significant FULL */ *dh-- = ((((HALF)src[SLEN-1] & lowhalf[BASEB-dnxtbit]) << dnxtbit) | (HALF)(src[0] >> (FULL_BITS-dnxtbit))); @@ -1775,7 +1775,7 @@ zrandskip(long cnt) printf("rand: skipped %d states\n", RAND_SKIP); } - /* no skip, just descrment use counter */ + /* no skip, just decrement use counter */ } else { --s100.need_to_skip; } @@ -1843,7 +1843,7 @@ zrandskip(long cnt) printf("rand: skipped %d states\n", RAND_SKIP); } - /* no skip, just descrment use counter */ + /* no skip, just decrement use counter */ } else { --s100.need_to_skip; } @@ -1910,7 +1910,7 @@ void zrand(long cnt, ZVALUE *res) { BITSTR dest; /* destination bit string */ - int trans; /* bits transfered */ + int trans; /* bits transferred */ int indx; /* shuffle entry index */ /* @@ -2036,7 +2036,7 @@ zrand(long cnt, ZVALUE *res) printf("rand: skipped %d states\n", RAND_SKIP); } - /* no skip, just descrment use counter */ + /* no skip, just decrement use counter */ } else { --s100.need_to_skip; } @@ -2104,7 +2104,7 @@ zrand(long cnt, ZVALUE *res) printf("rand: skipped %d states\n", RAND_SKIP); } - /* no skip, just descrment use counter */ + /* no skip, just decrement use counter */ } else { --s100.need_to_skip; } diff --git a/zrandom.c b/zrandom.c index 0e5f19d..d467a5e 100644 --- a/zrandom.c +++ b/zrandom.c @@ -357,7 +357,7 @@ * * http://www.LavaRnd.org/ * - * for an explination of how the LavaRnd random number generator works. + * for an explanation of how the LavaRnd random number generator works. * * For a given newn, we select a given bit length. For 0 < newn <= 20, * the bit length selected was by: