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.
Updated the cal/README to reflect the new names
of the calc regression test suite files.
Updated cal/Makefile to remove, when installing,
old names for calc regression test suite files.
Added missing getpgid_tmp to .gitignore.
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.
Fixed how the historical trigonometric functions call
the underlying trigonometric functions. This fixes a
number of issues where the function for values of 0.
Updated cal/regress.cal to test historical trigonometric functions
at the 0 value.
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".
Moved versin() and coversin() to bottom of functions in func.c
(however the builtin function list remains sorted).
Created a historical trig functions section for cmath.h and qmath.h.
Moved cal/test3500.cal to cal/test9300.cal to make room
for future trip tests going from test 3427 thru 3599.
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.
Change zispowerof2() interaface to take a FULL ptr as the 2nd arg:
zispowerof2(ZVALUE z, FULL *log2).
Added qispowerof2(NUMBER *q, NUMBER **qlog2) to qfunc.c.
Change log2() builtin to use the new qispowerof2() internal interface.
Update LIBRARY to reflect the new zispowerof2() internal interface
and the new qispowerof2() internal interface.
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 z*.c functions that take pointers that cannot be NULL are checked
for NULL pointers at the beginning of the function.
While calc is not known to pass bogus NULL pointers to ZVALUE related
code, libcalc could be called by external code that might do so by
mistake. If that happens, math_error() is called with the name of
the function and the name of the arg that was NULL.
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.
The make chk_c file also forms status.chk_c.h which either
defines CHK_C when the C compiler and select include files
appear to meet calc requirements, or undefines CHK_C
when it does not.
Fixed have_statfs optional executable file extension ${EXT{ in
the ${UTIL_PROGS} make variable.
Prevented the "fake boolean value" when <stdbool.h> is missing,
from complicating C compilers post c17 standard.
Test if <stdint.h> exists and set HAVE_STDINT_H accordingly
in have_stdint.h. Added HAVE_STDINT_H to allow one to force
this value.
Test if <inttypes.h> exists and set HAVE_INTTYPES_H accordingly
in have_inttypes.h. Added HAVE_INTTYPES_H to allow one to force
this value.
Added c_chk.c to check the compiler and C include for calc
requirements. If you are unable to compile this program, or
if this program when compiles does not exit 0, then your C
compiler and/or C include fails to meet calc requirements.
Compilers that are at least c99 MUST be able to compile this
program such that when run will exit 0.
The "make hsrc" file will attempt to compile and run c_chk and
will warn if the C compiler and/or C include fails to meet
calc requirements. The "make debug" system will run c_chk -c
to print information about the C compiler and C include.
Currently failure to compile cc_chk.c or c_chk exiting non-0
will just print "WARNING!!" strings to stderr.
Fix "Under source code control" date for new version.h file.
Sorted the order of symbols printed by "make env".
Test if <stdbool.h> exists and set HAVE_STDBOOL_H accordingly
in have_stdbool.h. Added HAVE_STDBOOL_H to allow one to force
this value.
Added "bool.h" include file to support use of boolean symbols,
true and false for pre-c99 C compilers. The "bool.h" include
file defines TRUE as true, FALSE as false, and BOOL as bool:
for backward compatibility.
The sign in a ZVALUE is now of type SIGN, whcih is either
SB32 when CALC2_COMPAT is defined, or a bool.
Replaced in C source, TRUE with true, FALSE with false, and
BOOL with bool.