Landon Curt Noll 5b7dfeaf11 Release v2.14.0.13
We apologize for the calc v2.14.0.12 source tarball that was missing
critical files.  While the executable was well tested, our release
process was deficient.

We are improved our release process and added tests during the release
procedure to help verify that we are not regressing in to the "v2.14.0.12
source tarball" issue, among other things.

Depending on how things do, you might is several releases come out over
a short period of time.  The core of calc isn't changing, so the calc
executable will be the same as we focus on the Makefiles, our release
procedure, and related documentation / help files.

Removed constructed help file that incorrectly added as a src file.

=-=

The following are the changes in this release:

    Minor tweak to seed() builtin.  Updated help/srand and help/srandom.

    Moved Makefile.ship into Makefile.

    Removed custom/Makefile.head and custom/Makefile.tail.

    The custom/Makefile is now part of source and includes Makefile.
    In particular, custom/Makefile makes use of the 'middle' of
    the new top level Makefile where calc's top level Makefile
    variables are defined.

    Makefile.simple and custom/Makefile.simple are now part of the source
    and are constructed from Makefile and custom/Makefile respectively.
    The Makefile.simple and custom/Makefile.simple avoid using GNU
    conditionals. They may be used with older/classic make commands.

    Makefile.local will include comments about how to better use
    it. Between releases, Makefile.local at the top of the master branch
    will contain how we typically build calc and test calc (FYI: we
    normally enable things such as -Werror -Wextra -pedantic).  When we
    push out a release, Makefile.local will be stripped of non-comment
    lines.  Thus, releases of calc, and, released "calc*.src.rpm"
    files and the source tarballs, will have a Makefile.local with
    only comments.

    The "README.*" files and "HOWTO.INSTALL" file have been updated.

    By default, compiler warnings have been turned up.  The Makefile
    variable ${CCWARN} now defaults to:

	CCWARN= -Wall -Wextra -pedantic

    The previous level of compiler warnings can be easily restored by
    adding to Makefile.local:

	CCWARN:= -Wall

    The readline, history and ncurses libraries are now default.
    The Makefile variables ${USE_READLINE}, ${READLINE_LIB}, and
    ${READLINE_EXTRAS} now default to:

	USE_READLINE= -DUSE_READLINE
	READLINE_LIB= -lreadline
	READLINE_EXTRAS= -lhistory -lncurses

    The previous mode where readline, history and ncurses libraries
    were not compiled in by default can be easily restored by
    adding to Makefile.local:

	USE_READLINE:=
	READLINE_LIB:=
	READLINE_EXTRAS:=

    We have renamed "stable" as "production".
    We have renamed "unstable" as "tested".

    On the web site:

	http://www.isthe.com/chongo/src/calc/

    these files has been renamed:

	2.x.y.z_IS_LATEST_STABLE   ==> 2.x.y.z_IS_LATEST_PRODUCTION
	2.x.y.z_IS_LATEST_UNSTABLE ==> 2.x.y.z_IS_LATEST_TESTED

    The terms 'stable' and 'unstable' were both misleading and
    inaccurate.  For details see the new documention file:

	README.RELEASE

    See also the help command:

	; help release

    Fixed bug impacting how have_ustat.h was formed.

    Updated help/archive to reflect GitHub use.
2021-12-13 14:43:37 -08:00
2021-12-13 14:23:47 -08:00
2021-12-13 14:43:37 -08:00
2021-12-13 14:43:37 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-08 14:12:23 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-07 21:41:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-08 12:33:46 -08:00
2021-12-05 18:23:27 -08:00
2021-10-22 03:09:08 -07:00
2021-02-12 16:07:00 -08:00
2017-05-21 15:38:58 -07:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-07 00:44:57 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-06 21:16:08 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-27 05:55:50 -07:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-11-27 00:05:28 -08:00
2021-12-07 21:41:28 -08:00
2021-12-13 14:23:47 -08:00
2021-12-13 14:23:47 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-07 02:24:50 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-06-09 13:09:33 -03:00
2021-12-05 18:23:27 -08:00
2021-12-01 22:50:52 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-02-12 15:50:39 -08:00
2021-12-05 18:23:27 -08:00
2021-02-12 22:09:47 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 23:12:24 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-01 23:15:06 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-03-11 01:54:28 -08:00
2021-12-07 02:24:50 -08:00
2021-03-11 01:54:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-07 02:24:50 -08:00
2021-12-13 14:23:47 -08:00
2021-12-07 21:41:28 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-05 18:23:27 -08:00
2021-12-07 02:24:50 -08:00
2021-12-05 23:36:05 -08:00

What is calc?

Calc is an interactive calculator which provides for easy large numeric calculations, but which also can be easily programmed for difficult or long calculations. It can accept a command line argument, in which case it executes that single command and exits. Otherwise, it enters interactive mode. In this mode, it accepts commands one at a time, processes them, and displays the answers. In the simplest case, commands are simply expressions which are evaluated. For example, the following line can be input:

3 * (4 + 1)

and the calculator will print:

15

Calc has the usual collection of arithmetic operators +, -, /, * as well as ^ (exponentiation), % (modulus) and // (integer divide). For example:

3 * 19^43 - 1

will produce:

29075426613099201338473141505176993450849249622191102976

Notice that calc values can be very large. For example:

2^23209-1

will print:

402874115778988778181873329071 ... many digits ... 3779264511

The special '.' symbol (called dot), represents the result of the last command expression, if any. This is of great use when a series of partial results are calculated, or when the output mode is changed and the last result needs to be redisplayed. For example, the above result can be modified by typing:

. % (2^127-1)

and the calculator will print:

47385033654019111249345128555354223304

For more complex calculations, variables can be used to save the intermediate results. For example, the result of adding 7 to the previous result can be saved by typing:

curds = 15
whey = 7 + 2*curds

Functions can be used in expressions. There are a great number of pre-defined functions. For example, the following will calculate the factorial of the value of 'whey':

fact(whey)

and the calculator prints:

13763753091226345046315979581580902400000000

The calculator also knows about complex numbers, so that typing:

(2+3i) * (4-3i)
cos(.)

will print:

17+6i
-55.50474777265624667147+193.9265235748927986537i

The calculator can calculate transcendental functions, and accept and display numbers in real or exponential format. For example, typing:

config("display", 70),
epsilon(1e-70),
sin(1)

prints:

0.8414709848078965066525023216302989996225630607983710656727517099919104

Calc can output values in terms of fractions, octal or hexadecimal. For example:

config("mode", "fraction"),
(17/19)^23
print
base(16),
(19/17)^29
print
log(79.3i)

will print:

19967568900859523802559065713/257829627945307727248226067259

0x9201e65bdbb801eaf403f657efcf863/0x5cd2e2a01291ffd73bee6aa7dcf7d1

0x17b5164ac24ee836bf/0xc7b7a8e3ef5fcf752+0x883eaf5adadd26be3/0xc7b7a8e3ef5fcf752i

All numbers are represented as fractions with arbitrarily large numerators and denominators which are always reduced to lowest terms. Real or exponential format numbers can be input and are converted to the equivalent fraction. Hex, binary, or octal numbers can be input by using numbers with leading '0x', '0b' or '0' characters. Complex numbers can be input using a trailing 'i', as in '2+3i'. Strings and characters are input by using single or double quotes.

Commands are statements in a C-like language, where each input line is treated as the body of a procedure. Thus the command line can contain variable declarations, expressions, labels, conditional tests, and loops. Assignments to any variable name will automatically define that name as a global variable. The other important thing to know is that all non-assignment expressions which are evaluated are automatically printed. Thus, you can evaluate an expression's value by simply typing it in.

Many useful built-in mathematical functions are available. Use the:

help builtin

command to list them.

You can also define your own functions by using the 'define' keyword, followed by a function declaration very similar to C.

define f2(n)
{
	local ans;

	ans = 1;
	while (n > 1)
		ans *= (n -= 2);
	return ans;
}

Thus the input:

f2(79)

will produce:

1009847364737869270905302433221592504062302663202724609375

Functions which only need to return a simple expression can be defined using an equals sign, as in the example:

define sc(a,b) = a^3 + b^3

Thus the input:

sc(31, 61)

will produce:

256772

Variables in functions can be defined as either 'global', 'local', or 'static'. Global variables are common to all functions and the command line, whereas local variables are unique to each function level, and are destroyed when the function returns. Static variables are scoped within single input files, or within functions, and are never destroyed. Variables are not typed at definition time, but dynamically change as they are used.

For more information about the calc language and features, try:

help overview

Calc has a help command that will produce information about every builtin function, command as well as a number of other aspects of calc usage. Try the command:

help help

for and overview of the help system. The command:

help builtin

provides information on built-in mathematical functions, whereas:

help asinh

will provides information a specific function. The following help files:

help command
help define
help operator
help statement
help variable

provide a good overview of the calc language. If you are familiar with C, you should also try:

help unexpected

It contains information about differences between C and calc that may surprise C programmers.

Languages
C 89.1%
Makefile 9.2%
Shell 0.8%
Roff 0.8%