The trigonometric file files have had several bug fixed.
The EXAMPLE sections of trigonometric file have
been made consistent.
Added these new help files in anticipation of
the code for these new (i.e., to be written) builtin functions:
hacovercos hacoversin havercos haversin
ahacovercos ahacoversin ahavercos ahaversin
NOTE: errstr was renamed to errsym.
Added errsym builtin function. The errsym(errnum | "E_STRING")
builtin, , when given a valid integer errnum that corresponds to a
calc error condition, will return an E_STRING string, AND when given
a valid E_STRING string that is associated with a calc error
condition, will return errnum integer that corresponds to a calc
error condition.
Supplying a non-integer numeric errnum code to error(), errno(),
strerror(), or errsym() will result in an error.
Now the "E_STRING" errsym strings in error_table[], with exception
to the 1st E__BASE entry, all other errsym strings must match the
following regular expression:
^E_[A-Z][A-Z0-9_]+$
Renamed "E_1OVER0" to "E_DIVBYZERO".
Renamed "E_0OVER0" to "E_ZERODIVZERO".
Rename the #define E__COUNT to ECOUNT to avoid confusion
with "E_STRING" error symbols.
Improve formatting of help/error, help/errno, and help/strerror.
Update .gitignore.
Changed calc_errno a global int variable so that is may be directly
accessed by libcalc users.
Further improve help files for help/errno, help/error, help/newerror,
help/stoponerror and help/strerror by adding to documentation
of the calc error code system as well as libcalc interface
where applicable.
Changed #define E_USERDEF to #define E__USERDEF.
Removed use of E_USERDEF, E__BASE, E__COUNT, and E__HIGHEST
from custom/c_sysinfo because the c_sysinfo is just a demo
and this will simplify the custom/Makefile.
The include file calcerr.h is now the errsym.h include file.
The calcerr.tbl has been replaced by errtbl.c and errtbl.h.
The calcerr_c.awk, calcerr_c.sed, calcerr_h.awk, and
calcerr_h.sed files are now obsolete and have been removed.
The calcerr.c and calcerr.h now obsolete and are no longer built.
The calc computation error codes, symbols and messages are now in
a error_table[] array of struct errtbl.
An E_STRING is a string corresponds to an error code #define.
For example, the E_STRING for the calc error E_STRCAT,
is the string "E_STRING". An E_STRING must now match
the regular expression: "^E_[A-Z0-9_]+$".
The old array error_table[] of error message strings has been
replaced by a new error_table[] array of struct errtbl. The struct
errtbl array holds calc errnum error codes, the related E_STRING
symbol as a string, and the original related error message.
To add new computation error codes, add them near the bottom of the
error_table[] array, just before the NULL entry.
The ./errcode utility, when run, will verify the consistency of
the error_table[] array.
The Makefile uses ./errcode -e to generate the contents of
help/errorcodes file. The help errorcodes now prints
information from the new cstruct errtbl error_table[] array.
The help/errorcodes.hdr and help/errorcodes.sed files are
now obsolete and have been removed.
The Makefile uses ./errcode -d to generate the contents of the
errsym.h include file.
Updated .gitignore and trailblank to support the above changes.
Changed calc_errno a global int variable so that is may be directly
accessed by libcalc users.
Further improve help files for help/errno, help/error, help/newerror,
help/stoponerror and help/strerror by adding to documentation
of the calc error code system as well as libcalc interface
where applicable.
Added help/errorcodes rule to the top level Makefile.
Added E_USERMAX symbol (== 32767) to indicate the maximum value
allowed for user error codes.
Improve help/error. Added text about error code ranges and
range symbols.
Added complex multiple approximation function to commath.c so
that users of libcalc may directly round complex number to
nearest multiple of a given real number:
E_FUNC COMPLEX *cmappr(COMPLEX *c, NUMBER *e, long rnd, bool cfree);
For example:
COMPLEX *c; /* complex number to round to nearest epsilon */
NUMBER *eps; /* epsilon rounding precision */
COMPLEX *res; /* c rounded to nearest epsilon */
long rnd = 24L; /* a common rounding mode */
bool ok_to_free; /* true ==> free c, false ==> do not free c */
...
res = cmappr(c, eps, ok_to_free);
The complex trigonometric functions tan, cot, sec, csc were implemented
in func.c as calls to complex sin and complex cos. We added the
direct calls to comfunc.c so that users of libcalc may
call them directly:
E_FUNC COMPLEX *c_tan(COMPLEX *c, NUMBER *eps);
E_FUNC COMPLEX *c_cot(COMPLEX *c, NUMBER *eps);
E_FUNC COMPLEX *c_sec(COMPLEX *c, NUMBER *eps);
E_FUNC COMPLEX *c_cot(COMPLEX *c, NUMBER *eps);
Improved help files for sin, cos, tan, cot, sec, csc. In case
of tan, cot, sec, csc corrected help file was corrected to
indicate that complex arguments are allowed. This was a help
file oversight from long ago when those trigonometric functions
Expanded the calc regression test suite test 34dd to test various
real and complex values for sin, cos, tan, cot, sec, csc.
Improved trig help files.
Added new vercos(x, [,eps]) for versed cosine and covercos(x, [,eps])
for inverse versed cosine.
Added new avercos(x, [,eps]) for inverse versed cosine and acovercos(x, [,eps])
for inverse coversed cosine.
In cases where the real value to the inverse versed sine and the
inverse coversed sine function produces a complex value, the
conversion from real to complex was incorrect.
Added c_to_q(COMPLEX *c, bool cfree) to make is easier to convert
a COMPLEX value that is real (imag part is 0) into a NUMBER and
optionally free the COMPLEX value.
The func.c code now uses c_to_q().
NOTE: There is a XXX bug marked in the f_aversin() and f_acoversin()
that still needs to be fixed.
Added new aversin(x, [,eps]) for inverse versed sine and acoversin(x, [,eps])
for inverse coversed sine.
Improved trig function help files to reference use of complex arguments
that while supported were not documented.
Removed old Makefile testing rules for make dbx and make gdb.
Improved "make run" to execute calccalc using shared libraries
from the local directory, and with reading of the startup scripts
disabled.
Changed "make prep" to perform various tests that are used to
help verify that calc is ready for a release.
Added Makefile testing rule testfuncsort to check for the sort
of the builtin function list. Changed the order that builtin
functions are listed by "show builtin" and the help/builtin to
match the sorting of "LANG=C LC_ALL=C sort -d -u".
Add new logn(x, n [,eps]) builtin to compute logarithms to base n.
Verify that eps arguments (error tolerance arguments that override
the default epsilon value) to builtin functions have proper values.
Previously the eps argument had little to no value checks for
many builtin functions.
Document in help files for builtin functions that take eps arguments,
the LIMIT range for such eps values.
Added log2(x [,eps]) builtin function. When x is an integer
power of 2, log2(x) will return an integer, otherwise it will
return the equivalent of ln(x)/ln(2).
Sort .gitignore. Add calc.spec to .gitignore.
Update format of header part of Makefiles.
Modify calc.spec.in to handle dynamic shared libraries with 3-digit
version numbers.
Removed the ${CAL_PASSDOWN}, ${HELP_PASSDOWN}, ${HELP_PASSDOWN},
${CSCRIPT_PASSDOWN} Makefile variables as the new Makefile
include files keep Makefile variables in sync.
Fixed the ability of calc to compile when CUSTOM is undefined
(i.e., -UCUSTOM). The libcustcalc is always built, regardless
of the $(ALLOW_CUSTOM} Makefile variable. However when CUSTOM
is undefined, the bulk of custom functions are not defined.
Moved makefile variables that configure calc and configure how to
compile calc from Makefile into a new Makefile.config file.
The Makeifle includes the Makefile.config file.
The cal/Makeifle includes the Makefile.config file.
The cscript/Makeifle includes the Makefile.config file.
The custom/Makeifle includes the Makefile.config file.
The help/Makeifle includes the Makefile.config file.
Now, the Makefile.config file will consistently configure
calc and how calc is compiled and built by all calc Makefiles.
The platform target section from the old Makefile has been moved to
a new file, Makefile.target. The custom/Makefile no longer includes
Makefile.
The Makeifle includes the Makefile.target file.
The cal/Makeifle includes the Makefile.target file.
The cscript/Makeifle includes the Makefile.target file.
The custom/Makeifle includes the Makefile.target file.
The help/Makeifle includes the Makefile.target file.
Now, the Makefile.target file will consistently set
target information for all calc Makefiles.
The cal/Makeifle includes the Makefile.local file.
The cscript/Makeifle includes the Makefile.local file.
The custom/Makeifle includes the Makefile.local file.
The help/Makeifle includes the Makefile.local file.
Thus, one may modify or append many Makefile variables
in all calc Makefiles.
Updated comments in Makefile.local for how to Diagnosing memory,
thread, and crash issues under RHEL and macOS.
We no longer support the Makefile variable ${ALLOW_CUSTOM} to be empty.
Normally ${ALLOW_CUSTOM} is:
ALLOW_CUSTOM= -DCUSTOM
Now, to disable custom disable custom even if -C is given, use:
ALLOW_CUSTOM="-UCUSTOM"
Added comments in Makefile.local for how to reduce dependency chains
under macOS. XXX - this doesn't yet work so don't uncomment - XXX.
Updated COPYING file to indicate that these files are now
covered under "The Unlicense" (see https://unlicense.org):
sha1.c
sha1.h
cal/dotest.cal
cal/screen.cal
Updated help/credit to match the above changes to COPYING.
Updated CONTRIB-CODE and calc.man to refer to using GitHub pull requests
for contributing to calc (instead of using Email).
Updated BUGS and calc.man to refer to using GitHub issues
for reporting calc bugs (instead of using Email).
Updated QUESTIONS and calc.man to refer to using GitHub issues
for asking calc questions (instead of using Email).
Fixed Makefile.local command example to refer to overriding the
Makefile variable DEBUG (instead of CDEBUG).
Fixed all make chk ASAN warnings under macOS 13.2.1 when calc is compiled
with the following uncommented lines in Makefile.local:
DEBUG:= -O0 -g
CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
Improved how pointers to functions are declared for the builtins
array in func.c to avoid function declarations without a prototype
that is now deprecated in C.
Improved how pointers to functions are declared for the opcodes
array in opcodes.c to avoid function declarations without a prototype
Replaced use of egrep with grep -E in Makefiles.
Fixed cases where variables were set but not used in symbol.c, calc.c,
and the main function in func.c as used by funclist.c.
Added rule name to "DO NOT EDIT -- generated by the Makefile" lines
in constructed files.
Test if <sys/vfs.h> exists and set HAVE_SYS_VFS_H accordingly
in have_sys_vfs.h. Added HAVE_SYS_VFS_H to allow one to force
this value.
Test if <sys/param.h> exists and set HAVE_SYS_PARAM_H accordingly
in have_sys_param.h. Added HAVE_SYS_PARAM_H to allow one to force
this value.
Test if <sys/mount.h> exists and set HAVE_SYS_MOUNT_H accordingly
in have_sys_mount.h. Added HAVE_SYS_MOUNT_H to allow one to force
this value.
Test if the system as the statfs() system call and set HAVE_STATFS
accordingly in have_statfs.h. Added HAVE_STATFS to allow one
to force this value.
The pseudo_seed() function will also try to call statfs() if
possible and permitted by the HAVE_STATFS value.
Added config("tilde_space", boolean) to help/config, along with
a few few minor text improvements. Updated cal/regress to test
config("tilde_space").
Added config("fraction_space", boolean). The "fraction_space" controls
whether or not a space (' ') is printed before and after fractions.
By default, config("fraction_space") is false.
For example, with the default, config("fraction_space", 0):
; base(1/3),
; 1/7
1/7
With config("fraction_space", 1):
; base(1/3),
; 1/7
1 / 7
NOTE: Use of config("fraction_space", 1) can break printing and scanning
of fractional values via "%r".
NOTE: Use of config("fraction_space", 1) can break printing and scanning
of complex values via "%c".
Added config("fraction_space", boolean) to help/config, along with
a few few minor text improvements. Updated cal/regress to test
config("tilde_space").
Added config("tilde_space", boolean). The "tilde_space" controls
whether or not a space (' ') is printed after leading tilde ('~').
By default, config("tilde_space") is true, which is a change
from past behavior. For example, now:
; 1/3
~ 0.33333333333333333333
With config("tilde_space", 0):
; 1/3
~0.33333333333333333333
To disable "tilde_space", use config("tilde_space", 0) on the
command line and/or use config("tilde_space", 0),; in your ~/.calcrc.
Thanks goes to <GitHub use ljramalho> for this suggestion.
Added config("tilde_space", boolean) to help/config, along with
a few few minor text improvements. Updated cal/regress to test
config("tilde_space") and to account for the new default.
Changed /*NOTREACHED*/ to not_reached(); and use "attribute.h".
Added .PHONY rule, just after all rule, to Makefiles.
Fixed an improper indentation issue.
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.
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.
We made several changes to the Makefiles. We also added a new
README.RELEASE document (see "help release") that is a work in
progress. Along the way we discovered a few things that needed to be
updated in documentation.
See the CHANGES file for details.
Fixed documentation that referred to the old additive 55
generator. We have been using the subtractive 100 in place
of the additive 55 generator for a while now.
Drop support for CLOCK_SGI_CYCLE.
Improved seed() generation. Improved some comments in seed.c.
Added have_environ.c to build have_environ.h in order to
determine if:
extern char **environ; /* user environment */
is an valid external symbol.