Added "STATIC bool blum_initialized = false" to zrandom.c to improve
how the code detects if the Blum-Blum-Shub pseudo-random number
generator is seeded or not, and how to free the state correctly.
NOTE: There is a very minor memory leak in zrandom.c that will be
fixed in a later release.
Updated BUGS about MSYS2 on Windows compiling of calc.
Added more git related checks and sanity checks to chk_tree.
Added ${FSANITIZE} make variable to Makefile.config to hold
common Address Sanitizer (ASAN) optins to modern Linux and macOS.
The Address Sanitizer is NOT enabled not compiled in by default.
Improved comments in Makefile.local for RHEL9.2 (Linux) and for
macOS 14.0 that, when uncommented and calc is recompiled (i.e.,
make clobber all) will enable the Address Sanitizer (ASAN) for calc.
The tarball for calc version 2.15.0.0 was missing version.h.
The version.h is now listed as part of the calc distribution.
Added a chk_tree tool to help look for problems such as files that are
result of building calc that are also part of the calc distribution,
and files that are part of the calc source that are missing from the
calc distribution, and files that are of unknown status that are either
result of building calc nor missing from the calc distribution.
Updated file lists in Makefile, sorting as needed.
Updated Makefile PHONY rule to include Makefile rules that are NOT files.
Reduced make chatter for rules that build lists.
Added make verifydist to verify the existence of files that are part of
the calc distribution.
Added make verifydist to make prep.
Added a chk_tree double check, one after make clobber, one before the
final make chk, to make prep.
When printing an error, calc used to print the errnum (error number):
; 1/0
Error 10001
Calc now prints the errsym (errsym):
; 1/0
Error E_DIVBYZERO
Added errsym E_LN_3 for ln(0).
Added errsym E_LOG_5 for log(0).
Added errsym E_LOG2_4 for log2(0).
Added errsym E_LOGN_6 for logn(0,base).
The config("triground") controls rounding for the following
trigonometric and hyperbolic functions:
sin, cos, tan, cot, sec, csc
asin, acos, atan, acot, asec, acsc
versin, coversin, vercos, covercos
aversin, acoversin, avercos, acovercos
haversin, hacoversin, havercos, hacovercos
ahaversin, hacoversin, havercos, ahacovercos
exsec, aexsec, excsc, aexcsc
crd, acrd
cas, cis
sinh, cosh, tanh, coth, sech, csch
asinh, acosh, atanh, acoth, asech, acsch
In addition to taking a complex root (such as via the power
function on a complex value), "triground" is used for:
exp, polar
For the above mentioned functions, the rounding mode used to
round the result to the nearest epsilon value is controlled by,
and defaults to:
config("triground", 24)
As with other config options, the call returns the previous mode,
without a 2nd argument, returns the current mode without changing it:
config("triground")
Improved "SEE ALSO" for the hyperbolic function help files.
Improve builtin function strings, as printed by help builtin,
that use an optional accuracy (epsilon) arg by adding a comma.
Added the following new trigonometric functions:
crd(x [,eps]) trigonometric chord of a unit circle
acrd(x [,eps]) inverse trigonometric chord of a unit circle
Added the following new trigonometric functions:
exsec(x [,eps]) exterior trigonometric secant
aexsec(x [,eps]) inverse exterior trigonometric secant
excsc(x [,eps]) exterior trigonometric cosecant
aexcsc(x [,eps]) inverse exterior trigonometric cosecant
Added to test 95dd and test9500.trigeq.cal to the calc regression test
suite to perform extensive test of trigonometric functions.
Added to test 34dd, some if the missing inverse trigonometric tests.
Fixed SEE ALSO typo in help randperm.
Added the following new trigonometric functions:
haversin(x [,eps]) half versed trigonometric sine
hacoversin(x [,eps]) half coversed trigonometric sine
havercos(x [,eps]) half versed trigonometric cosine
hacovercos(x [,eps]) half coversed trigonometric cosine
ahaversin(x [,eps]) inverse half versed trigonometric sine
ahacoversin(x [,eps]) inverse half coversed trigonometric sine
ahavercos(x [,eps]) inverse half versed trigonometric cosine
ahacovercos(x [,eps]) inverse half coversed trigonometric cosine
Fixed calc regression test 42dd to set the display value back to 20.
Added test 95dd and test9500.trigeq.cal to the calc regression test
suite to perform extensive test of trigonometric functions.
Fix and improve recently comments and variable names added new
trigonometric functions in comfunc.c, func.c, qtrans.c.
Rename E_BROUND to E_BROUND_1 as per an earlier change
on the E_STRING formats.
E_BROUND ==> E_BROUND_1
Improve the ciarify of calc regression suite (regress.cal) to mostly
use E_STRING errsym instead of numeric errnum values for error()
and errno() related tests.
Added tests to the calc regression test suite (cal/regress.cal) to
verify that the errnum calc computation error codes and their
E_STRING values have not changed.
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.
Fixed more documentation and code comments that referred to the old
additive 55 (a55) shuffle pseudo-random number generator. We have
been using the subtractive 100 shuffle pseudo-random number generator
in place of the additive 55 generator for a while now.
To make the meaning a bit more clear in cal/regress.cal, we have
renamed the following test calc resource files that are related to
the calc regression test suite:
cal/test1700.cal -> cal/test8000.read.cal
cal/test2300.cal -> cal/test2300.obj_incdec.cal
cal/test2600.cal -> cal/test2600.numfunc.cal
cal/test2700.cal -> cal/test2700.isqrt.cal
cal/test3100.cal -> cal/test3100.matobj.cal
cal/test3400.cal -> cal/test3400.trig.cal
cal/test4000.cal -> cal/test4000.ptest.cal
cal/test4100.cal -> cal/test4100.redc.cal
cal/test4600.cal -> cal/test4600.fileop.cal
cal/test5100.cal -> cal/test5100.newdecl.cal
cal/test5200.cal -> cal/test5200.globstat.cal
cal/test8400.cal -> cal/test8400.quit.cal
cal/test8500.cal -> cal/test8500.divmod.cal
cal/test8600.cal -> cal/test8600.maxargs.cal
cal/set8700.cal -> cal/test8700.dotest.cal
cal/test8900.cal -> cal/test8900.special.cal
cal/test9300.cal -> cal/test9300.frem.cal
Added to test 94dd, read of a number of new calc resource files
that are not already read as a result of the calc regression test suite.
Improve comments about use of the ${CALC_ENV} Makefile variable.
Noted in Makefile.cal where and how the ${CALC_ENV} is used.
Use ${CALC_ENV} Makefile variable were needed.
Modified regression test cal/regress.cal: in some cases test numbers
were adjusted. Add comments indicate which test numbers apply to
which code. Indicated where there is room for new tests.
Expanded the end of test numbers from 9999 to 99999.
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.
Removed CALC2_COMPAT in favor of ckecking if MAJOR_VER < 3.
The sign element in a ZVALUE is now of type SIGN, which is either
SB32 when MAJOR_VER < 3, or a bool otherwise.
The len element in a ZVALUE is of type LEN. LEN type is SB32 when
MAJOR_VER < 3, or a uintptr_t otherwise.
Noted version.h symbols in README.RELEASE instead of CALC2_COMPAT.
Improve .gitignore. Add excludes of hsrc temporary and test
programs. Added note about how the list is sorted.
Moved the generic excludes to the top.
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).
Removed `-R release_file` and `-r release_file` command
line options from `ver_calc`. Add `-h` option. Updated
comments in "README.RELEASE", which serves as the contents
of the calc command "help release".
The int.h will trigger an error when CHK_C is undefined and MAJOR_VER
>= 3. Improved the int.h error message in this case.
Added some comments and C integers to int.h.
Added int.h as a centeral place for calc integer types and integer macros.
Currently zmath.c includes int.h but does not yet use it.
Added missing ptr type checks to chk_c.c.