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.
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.
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.
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).
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("complex_space", boolean). The "complex_space" controls
whether or not a space (' ') is printed before and after the + or -
in complex values.
By default, config("complex_space") is false.
For example, with the default, config("complex_space", 0):
; asin(2)
1.57079632679489661923-1.31695789692481670863i
With config("complex_space", 1):
; asin(2)
1.57079632679489661923 - 1.31695789692481670863i
NOTE: Use of config("complex_space", 1) can break printing and scanning
of fractional values via "%r".
NOTE: Use of config("complex_space", 1) can break printing and scanning
of complex values via "%c".
Added config("complex_space", boolean) to help/config, along with
a few few minor text improvements. Updated cal/regress to test
config("complex_space").
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.
While 0^0 == 1, now for y > 0, 0^y == 0.
Adjusted cal/test8900.cal to reflect the this bug fix.
Added tests to cal/regress.cal to help verify bug fix is fixed.
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.
Added builtin functions to convert between degrees, minutes and
seconds and degrees under the config("mod") round rules:
dms2d(d, m, s [,rnd]) - convert deg, min, and secs to deg
dm2d(d, m [,rnd]) - convert deg, min to deg
See help/dms2d and help/dm2d.
Example:
; print dms2d(12, 20, 44.16);
12.3456
; print dm2d(3601, -25.5594);
0.57401
Added builtin functions to convert between gradians, minutes and
seconds and gradians under the config("mod") round rules:
gms2g(g, m, s [,rnd]) - convert grad, min, and secs to grad
gm2g(g, m [,rnd]) - convert grad and min to grad
See help/g2gms and help/g2gm.
Example:
; print gms2g(12, 20, 44.16);
12.3456
; print gm2g(4001, -25.5594);
0.57401
Added builtin functions to convert between hours, minutes and
seconds and hours under the config("mod") round rules:
hms2h(h, m, s [,rnd]) - convert hours, min, and secs to hours
hm2h(h, m [,rnd]) - convert hours, min to hours
See help/hms2h and help/hm2h.
Example:
; print hms2h(12, 20, 44.16);
12.3456
; print hm2h(241, -25.5594);
0.57401
Added several conversion functions:
Added builtin functions to convert between degrees and
degrees, minutes and seconds under the config("mod")
round rules:
d2dms(degs, d, m, s [,rnd]) - given degs, compute d, m, s
d2dm(degs, d, m [,rnd]) - given degs, compute d, m
See help/d2dms and help/d2dm.
Example:
; print d2dms(360.321,deg=,min=,sec=), deg, min, sec;
0.321 0 19 15.6
; print d2dm(360.321,deg=,min=), deg, min;
0.321 0 19.26
Added builtin functions to convert between gradians and
gradians, minutes and seconds under the config("mod")
round rules:
g2gms(grads, g, m, s [,rnd]) - given grads, compute g, m, s
g2gm(grads, g, m [,rnd]) - given grads, compute g, m
See help/g2gms and help/g2gm.
Example:
; print g2gms(400.321,grad=,min=,sec=), grad, min, sec;
0.321 0 19 15.6
; print g2gm(400.321,grad=,min=), grad, min;
0.321 0 19.26
Added builtin functions to convert between hours and
hours, minutes and seconds under the config("mod")
round rules:
h2hms(hours, h, m, s [,rnd]) - given hours, compute h, m, s
h2hm(hours, h, m [,rnd]) - given hours, compute h, m
See help/h2hms and help/h2hm.
Example:
; print h2hms(24.321,hour=,min=,sec=), hour, min, sec;
0.321 0 19 15.6
; print h2hm(24.321,hour=,min=), hour, min;
0.321 0 19.26
In addtion:
Renumbered regression tests 3408 thru 3437, to 9102 thru 9131.
Updated Added hms.cal resource file to use h2hms() builtin.
Updated Added dms.cal resource file to use d2dms() builtin.
Fix minor typo in help/mod SYNOPSIS.
Fix minor typo in help/quo SYNOPSIS.
Added a few more examples to help/strcmp.
Updated CHANGES.
Updated help/unexpected.
Added help files for d2g(), d2r(), g2d(), g2r(), r2d(), r2g().
Added regression test code for the same functions.
Fixed a few minor typos.
Fixed how the *.tar.bz2 are formed. The calc-2.12.8.0.tar.bz2 file
that was formed for calc version 2.12.8.0 was missing most files.
Expanded 'make chk' to also verify that 'make distchk' and 'make
distlist' execute successfully. This will help check a regression
of the bug that produced the bogus calc-2.12.8.0.tar.bz2 file.
Added additional regression tests related 0^(zero_expression)==1.
This code %g is preliminary.
Fixed some code style issues to match the current code style.
Added regression tests and help file updates to printf and strprintf.
Fixed use of magic number -4: using -P instead.
Noted two problem areas with XXX comments in qio.c:
1) need a qprintfg function
2) re-write to not modify conf->outdigits
Some folks might think: “you still use RCS”?!? And we will say,
hey, at least we switched from SCCS to RCS back in … I think it was
around 1994 ... at least we are keeping up! :-) :-) :-)
Logs say that SCCS version 18 became RCS version 19 on 1994 March 18.
RCS served us well. But now it is time to move on. And so we are
switching to git.
Calc releases produce a lot of file changes. In the 125 releases
of calc since 1996, when I started managing calc releases, there
have been 15473 file mods!