-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathCHANGES
9439 lines (6531 loc) · 364 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
The following are the changes from calc version 2.15.0.7 to 2.15.1.0:
Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The command `git diff -w` reports no changes. There is no
functionality change in calc: only ASCII tabs to ASCII spaces.
Fixed trailblank. It was pruning . in its find search.
Added check for ASCII tabs is non-Makefiles.
This version will form the basis for the calc v2 to calc v3 fork.
The following are the changes from calc version 2.15.0.6 to 2.15.0.7:
Thanks to GitHub user @bambooleafz a critical bug (GitHub issue
#148 - https://github.com/lcn2/calc/issues/148) they identified
was fixed.
The following are the changes from calc version 2.15.0.5 to 2.15.0.6:
Thanks to GitHub user @ashamedbit, a long standing memory leak in
zrandom.c has been fixed.
The following are the changes from calc version 2.15.0.4 to 2.15.0.5:
make clobber now removes the legacy files: have_fpos.h, help/man,
and help/usage. The latter 2 are now managed as help aliases
in help.c.
make install now removes the legacy files: ${HELPDIR}/man
and ${HELPDIR}/usage.
Fixed a problem where, when calc was linked with and uses GNU
readline then for any multi-line copy-and-paste, only the first
line is executed. Thanks to GitHub user @malfisya for reporting
this problem, and thanks to GitHub user @gromit1811 for doing
the research needed to overcome deficiencies in the GNU readline
documentation, and for supplying the work-a-round to allow
multi-line copy-and-paste to work as expected!
The following are the changes from calc version 2.15.0.3 to 2.15.0.4:
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. Be sure to use ||'s between []'s
to avoid problems with legacy shell such as the Bourne shell. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
The following are the changes from calc version 2.15.0.1 to 2.15.0.2:
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.
Fixed memory leaks in the logn, aversin, acoversin, avercos,
acovercos, ahaversin, ahavercos, ahacovercos, aexsec,
aexcsc, and acrd.
Fixed a compile error in zmath.h that impacted legacy 32-bit Big
Endian machines. Thanks goes to GitHub user @gromit1811 for their
pull request.
Fixed the check for <sys/mount.h> when forming have_sys_mount.h.
Thanks goes to GitHub user @gromit1811 for their pull request.
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.
The following are the changes from calc version 2.14.3.5 to 2.15.0.1:
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 the following new trigonometric functions:
versin(x [,eps]) versed trigonometric sine
coversin(x [,eps]) coversed trigonometric sine
vercos(x [,eps]) versed trigonometric cosine
covercos(x [,eps]) coversed trigonometric cosine
aversin(x [,eps]) inverse versed trigonometric sine
acoversin(x [,eps]) inverse coversed trigonometric sine
avercos(x [,eps]) inverse versed trigonometric cosine
acovercos(x [,eps]) inverse coversed trigonometric cosine
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
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
crd(x [,eps]) trigonometric chord of a unit circle
acrd(x [,eps]) inverse trigonometric chord of a unit circle
cas(x [,eps]) trigonometric cosine plus sine
cis(x [,eps]) Euler's formula
As Msys2 is a fork of Cygwin, if the OSNAME is Msys, the Cygwin
target will be used. Thanks to GitHub user @iahung2 for the
pull request.
Support for win32 and DJGPP has been dropped. Calc version
2.14.3.5 was the last to make references to win32 and make
references to DJGPP. Future versions of calc may work under
those systems, we just elected to remove the somewhat out of
date and awkward `win32.mkdef` and related win32 references.
If you are a win32 user, please feel free to create a win32
target in Makefile.target and submit as a pull request.
If you are a DJGPP user, please feel free to create a DJGPP
target in Makefile.target and submit as a pull request.
Until someone can test such systems, we prefer to wait
until someone is able to test and supply a pull request.
Added PTR_LEN (length of a pointer) and PTR_BITS (bit length
of a pointer) to longbits.h.
Moved calc version definition from version.c to version.h.
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.
Replaced in C source, TRUE with true, FALSE with false, and
BOOL with bool.
Fixed have_statfs optional executable file extension ${EXT{ in
the ${UTIL_PROGS} make variable.
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.
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.
Added int.h as a central place for calc integer types and
integer macros.
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".
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 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.
Setting an invalid epsilon via the epsilon(value) or confiv("epsilon",
value) triggers an error. The epsilon value must be: 0 < epsilon < 1.
Added 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 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 the
update_ver tool, (formerly verupdate) and the trailblank tool
that existed outside of the calc source base but neverthless
used in the calc release process. Both of these tools are used
by "make prep".
Added Makefile testing rule "make 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".
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().
Added q_to_c(NUMBER *q) to make it easier to convert a NUMBER
into an allocated COMPLEX value.
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.
Improved 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.
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.
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.
Improved help files trigonometric functions. They were corrected
to indicate that complex arguments are allowed: an oversight
from long ago when those trigonometric functions were expanded
to include complex arguments. The EXAMPLE sections were expanded
and made consistent, where applicable, across the trigonometric
help files. Documented libcalc functions in the SEE ALSO sections.
Improved "SEE ALSO" for the hyperbolic function help files.
Expanded the calc regression test suite test 34dd to test various
real and complex values for trigonometric functions.
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 following 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);
Added help/errorcodes rule to the top level Makefile.
Added E_USERMAX symbol (== 32767) to indicate the maximum value
allowed for user error codes.
Improved help/error. Added text about error code ranges and
range symbols.
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.
Code that used the old array error_table[] of error message strings
such as:
#include "calcerr.h"
char *msg; /* calc computation error message */
msg = error_table[errnum - E__BASE];
where errnum is the calc computation error code
E__BASE <= errnum <= E__HIGHEST, may now use:
#include "errtbl.h"
#include "errsym.h"
char *msg; /* calc computation error message */
msg = error_table[errnum - E__BASE].errmsg;
Rename the #define E__COUNT to ECOUNT to avoid confusion
with "E_STRING" error symbols.
Renamed "E_1OVER0" to "E_DIVBYZERO".
Renamed "E_0OVER0" to "E_ZERODIVZERO".
The verify_error_table() function that does a verification
the error_table[] array and setup private_error_alias[] array
is now called by libcalc_call_me_first().
Fix comment about wrong include file in have_sys_mount.h.
Removed unused booltostr() and strtobool() macros from bool.h.
Moved define of math_error(char *, ...) from zmath.h to errtbl.h.
The errtbl.h include file, unless ERRCODE_SRC is defined
also includes attribute.h and errsym.h.
Added E_STRING to error([errnum | "E_STRING"]) builtin function.
Added E_STRING to errno([errnum | "E_STRING"]) builtin function.
Added E_STRING to strerror([errnum | "E_STRING"]) builtin function.
Calling these functions with an E_STRING errsym is the same as calling
them with the matching errnum code.
Standardized on calc computation error related E_STRING strings
where there are a set of related codes. Changed "E_...digits" into
"E_..._digits". For example, E_FPUTC1 became E_FPUTC_1, E_FPUTC2
became E_FPUTC_2, and E_FPUTC3 became E_FPUTC_3. In a few cases
such as E_APPR became E_APPR_1, because there was a E_APPR2 (which
became E_APPR_2) and E_APPR3 (which became E_APPR_3). To other
special cases, E_ILOG10 became E_IBASE10_LOG and E_ILOG2 became
E_IBASE2_LOG because E_ILOG10 and E_ILOG2 are both independent calc
computation error related E_STRING strings. Now related sets of
E_STRING strings end in _ (underscore) followed by digits.
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 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.
Improved the clarity of calc regression suite (regress.cal) to mostly
use E_STRING errsym instead of numeric errnum values for error()
and errno() related tests.
Fixed SEE ALSO typo in help randperm.
Fixed calc regression test 42dd to set the display value back to 20.
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.
Improved builtin function strings, as printed by help builtin,
that use an optional accuracy (epsilon) arg by adding a comma.
The following are the changes from calc version 2.14.3.4 to 2.14.3.5:
Under macOS, to reduce dependency chains, we remove functions
and data that are unreachable by the entry point or exported
symbols. In particular, the macOS linker is used with both
"-dead_strip" and "-dead_strip_dylibs".
The libcalc shared library is now linked with libcustcalc.
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")
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).
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. Added double pass of chk_tree to
make full_debug (and thus to the make debug output).
Improved notes for install locations in Makefile.config.
Added printing of ${BUILD_ALL} to make env output.
The following are the changes from calc version 2.14.3.0 to 2.14.3.4:
Fix typo in the `make debug` Makefile rule.
Improved .gitignore to ignore .static, calc-static,
sample_many-static and sample_rand-static.
Improved error messages when trying to compile with
with one calc type (when BLD_TYPE=calc-dynamic-only or
BLD_TYPE=calc-static-only) and install with the other.
When installing with BLD_TYPE=calc-static-only, the
installed calc and calc-static are links to each other.
Thanks to GitHub user @TurtleWilly for this suggestion.
The dynamic shared libraries are not installed if they are not
built. So when installing with BLD_TYPE=calc-static-only, the
install rule will not attempt to install dynamic shared libraries.
Thanks to GitHub user @TurtleWilly for bringing to our attention,
problems related to building a statically linked calc under macOS.
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"
Dropped support of Makefile.simple and custom/Makefile.simple.
The calc version 2.14.3.0 is the last release that supported
the Makefile.simple and custom/Makefile.simple files.
Now, a make that supports makefile conditional syntax is required.
The simple target, a target that only was used for Makefile.simple
was removed.
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 custom/Makefile no longer includes Makefile.
The platform target section from the old Makefile has been moved
to a new file, Makefile.target. Improved the format and comments
in target information.
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.
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.
Dropped the use of Makefile variable ${SET_INSTALL_NAME}.
Under macOS it was always needed, elsewhere it was not.
Added Makefile variable ${VER} to hold the calc major release version.
The calc major release version is a 3 level version (x.y.z).
Under macOS, the current version of both libcalc and libcustcalc
shared libraries are set to the current calc major release version.
Under macOS, to reduce dependency chains, we remove functions and
data that are unreachable by the entry point or exported symbols.
In particular, the macOS linker is used with "-dead_strip" by default.
While calc on macOS will execute if linker used with "-dead_strip_dylibs"
and CUSTOM is defined, other applications that use libcalc but not
libcustcalc (such as sample_many and sample_rand) will fail to execute
due to missile symbols. Therefore "-dead_strip_dylibs" is not used
by default when ALLOW_CUSTOM is "-DCUSTOM" under macOS.
Thanks to GitHub user @TurtleWilly for bringing to our attention,
problems related to use of "-dead_strip_dylibs".
When installing shared libraries, libcalc.x.y.z will be a link
to the libcalc shared library and libcustcalc.x.y.z will be a link
to the libcustcal shared library.
The following are the changes from calc version 2.14.2.1 to 2.14.3.0:
Added cal/fnv_tool.cal, a calc resource file defining:
find_fnv_prime(bits)
deprecated_fnv0(bits,fnv_prime,string)
fnv_offset_basis(bits,fnv_prime)
fnv1a_style_hash(bits,fnv_prime,prev_hash,string)
Fixed sorted order of cal/README.
Removed references to obsolete Email addresses.
macOS Darwin defaults LCC to "cc".
Updated COPYING to include the actual text of "The Unlicense".
Made minor formatting changes to the file.
The Darwin specific ${DARWIN_ARCH}, thay by default was unset,
is now the ${ARCH_CFLAGS} Makefile variable. Comments about
various "-arch name" have been moved to the ${ARCH_CFLAGS} area.
For old Apple Power PC systems, the following is added:
COMMON_CFLAGS+= -std=gnu99
COMMON_LDFLAGS+= -std=gnu99
ARCH_CFLAGS+= -arch ppc
Old Apple Power PC systems should be detected by the
"uname -p" command returning "powerpc". One may force the
Power PC mode by adding to the end of any make command:
make ...make_args... target=Darwin arch=powerpc
or by adding the following in the Makefile.local file:
target= Darwin
arch= powerpc
Improved the output of the calcinfo rule by adding echos
of various uname values as well as some top Makefile variables.
Fixed the BUGS file with respect to using `make debug`.
Added a final ls of `debug.out` for `make debug`.
The following are the changes from calc version 2.14.2.0 to 2.14.2.0:
Ported calc to the s390x IBM Mainframe running RHEL9.1.
Added cal/splitbits.cal:
splitbits(x, b)
Given an integer x, split the value into a list of integers,
each of which is at most b bits long.
The value b must be an integer > 0.
The number of elements in the returned list is:
ceil((highbit(x) + 1) / b)
If x == 0, then a list of 1 element containing 0 is returned.
If x < 0, then the two's compliment of abs(x) is returned.
Even though calc represents negative integers as positive values
with sign bit, the bits returned by this function are as if
the integer converted as if the integer was a two's compliment value.
See also the help command:
; help resource
The following are the changes from calc version 2.14.1.5 to 2.14.1.6:
Fixed version numbers in two cases in CHANGES that referred
to the 2.14.2.x instead of 2.14.1.x.
Rename MINGW Makefile variable (a holdover from MINGW32_NT-5.0)
to OSNAME.
Fixed FUNCPTR typedef in hist.c to fix deprecated compiler warnings.
Fixed when USE_READLINE, READLINE_LIB, READLINE_EXTRAS, and
READLINE_INCLUDE are set to empty (disable use of the GNU-readline
facility).
Fix cases of spaces before tabs in Makefile and Makefile.simple.
Fixed obsolete references to the atoz() in LIBRARY to use the
correct internal function name of str2z().
Fixed obsolete references to the atoq() in LIBRARY to use the
correct internal function name of str2q().
Document in help/unexpected that * operator has has a higher
precedence than << in calc, which differs from C. Thanks
goes to GitHub user @inguin for pointing put this difference.
The following are the changes from calc version 2.14.1.3 to 2.14.1.4:
Fixed missing <string.h include in have_fpos_pos.c.
Change calc version from 2.14.1.2 to 2.14.2.3 as part of a test to
build calc RPMs on a reference RHEL8.7 platform (formerly a RHEL7.9
platform).
Changes #! lines in Makefiles to "#!/usr/bin/env make".
Set SHELL in Makefiles to the basename of the shell.
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.
Test if makedepend command is available before trying to build
the Makefile dependency list via "make depend".
The following are the changes from calc version 2.14.1.0 to 2.14.1.2:
Attempted to address a paranoid compiler warning -Wmaybe-uninitialized
in swap_HALF_in_ZVALUE() where the gcc compiler seems to ignore the
fact that calling not_reached() above the call to zcopyval()
should prevent dest from being NULL to the 1st zcopyval() call.
Thanks to <GitHub user mattdm> for raising this potential concern.
Fixed a -Wuse-after-free warning that identified a call to realloc()
in find_tty_state() could move the fd_setup array. Thanks goes to
<GitHub user mattdm> for reporting this bug!
In find_tty_state(), we changed how we expand fd_orig as an original
pre-modified copy of fd_setup. We realloc the fd_orig array and copy
the fd_setup into it first, before touching the fd_setup array.
In pseudo_seed(), we removed a call to setjmp() that was only
there to add more information to mix into the seed. For compilers
such as gcc that used -Wclobbered, the call to setjmp() gave the
impression that the hash_val might be clobbered by a longjmp().
Where there is no longjmp() that would use the previous setjmp(),
the gcc compiler has nil ways to notice that. So to avoid confusion
we removed the setjmp() call. Thanks to <GitHub user mattdm> for
raising this potential concern.
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 false.
For example, with the default, config("tilde_space", 0):
; 1/3
~0.33333333333333333333
; sqrt(7 + 5i,1e-100)
~2.79305614578749801863+~0.89507688693280053094i
With config("tilde_space", 1):
; 1/3
~ 0.33333333333333333333
; sqrt(7 + 5i,1e-100)
~ 2.79305614578749801863+~ 0.89507688693280053094i
NOTE: Use of config("tilde_space", 1) can break printing and scanning
of complex values via "%c".
To enable "tilde_space", use config("tilde_space", 1) on the
command line and/or use config("tilde_space", 1),; 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").
For example, with the default, config("tilde_space", 0):
; pi(1e-50)
~3.14159265358979323846
With config("tilde_space", 1):
; pi(1e-50)
~ 3.14159265358979323846
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("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