Commit Graph

33 Commits

Author SHA1 Message Date
Landon Curt Noll
f5c5cea8b0 Correct typos 2021-12-05 18:23:27 -08:00
Landon Curt Noll
f794b8d859 Reduce global status constants
The constants:

	9, 9/10, 10/9, 24, 360, 400

are used by func.c only, so there were moved
from {q,z}math.{c,h} to func.c.

The constants:

	3, 4

are used by zrandom.c only, so there were moved
from {q,z}math.{c,h} to zrandom.c.
2021-12-01 22:50:52 -08:00
Landon Curt Noll
9e92d4a35a Change initnumbs[] to be NULL terminated 2021-09-28 22:32:06 -07:00
Landon Curt Noll
cf419fb329 Added several conversion funcions, plus minor updates
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.
2021-09-26 04:38:09 -07:00
Landon Curt Noll
554cd97145 Initial code for g2d() & d2g() builtins
We still need to add:

    help files for g2d & d2g
    regression tests for g2d & d2g
    notes in related trig help files
    note in unexpected help file
    note in CHANGES
2021-09-07 07:59:51 -07:00
Landon Curt Noll
ac0d84eef8 Release v2.12.9.0
Added notes to help/unexpected about:

    display() will limit the number of digits printed after decimal point

    %d will format after the decimal point for non-integer numeric values

    %x will format as fractions for non-integer numeric values

    fprintf(fd, "%d\n", huge_value) may need fflush(fd) to finish

Fixed Makefile dependencies for the args.h rule.

Fixed Makefile cases where echo with -n is used.  On some systems,
/bin/sh does not use -n, so we must call /bin/echo -n instead
via the ${ECHON} Makefile variable.

Add missing standard tools to sub-Makefiles to make them
easier to invoke directly.

Sort lists of standard tool Makefile variables and remove duplicates.

Declare the SHELL at the top of Makefiles.

Fixed the depend rule in the custom Makefile.

Improved the messages produced by the depend in the Makefiles.

Changed the UNUSED define in have_unused.h to be a macro with
a parameter.  Changed all use of UNUSED in *.c to be UNUSED(x).

Removed need for HAVE_UNUSED in building the have_unused.h file.

 CCBAN is given to ${CC} in order to control if banned.h is in effect.

 The banned.h attempts to ban the use of certain dangerous functions
 that, if improperly used, could compromise the computational integrity
 if calculations.

 In the case of calc, we are motivated in part by the desire for calc
 to correctly calculate: even during extremely long calculations.

 If UNBAN is NOT defined, then calling certain functions
 will result in a call to a non-existent function (link error).

 While we do NOT encourage defining UNBAN, there may be
 a system / compiler environment where re-defining a
 function may lead to a fatal compiler complication.
 If that happens, consider compiling as:

    make clobber all chk CCBAN=-DUNBAN

 as see if this is a work-a-round.

 If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us!
 Please send us a bug report.  See the file:

    BUGS

 or the URL:

    http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html

 for how to send us such a bug report.

 Added the building of have_ban_pragma.h, which will determine
 if "#pragma GCC poison func_name" is supported.  If it is not,
 or of HAVE_PRAGMA_GCC_POSION=-DHAVE_NO_PRAGMA_GCC_POSION, then
 banned.h will have no effect.

 Fixed building of the have_getpgid.h file.
 Fixed building of the have_getprid.h file.
 Fixed building of the have_getsid.h file.
 Fixed building of the have_gettime.h file.
 Fixed building of the have_strdup.h file.
 Fixed building of the have_ustat.h file.
 Fixed building of the have_rusage.h file.

 Added HAVE_NO_STRLCPY to control if we want to test if
 the system has a strlcpy() function.  This in turn produces
 the have_strlcpy.h file wherein the symbol HAVE_STRLCPY will
 be defined, or not depending if the system comes with a
 strlcpy() function.

 If the system does not have a strlcpy() function, we
 compile our own strlcpy() function.  See strl.c for details.

 Added HAVE_NO_STRLCAT to control if we want to test if
 the system has a strlcat() function.  This in turn produces
 the have_strlcat.h file wherein the symbol HAVE_STRLCAT will
 be defined, or not depending if the system comes with a
 strlcat() function.

 If the system does not have a strlcat() function, we
 compile our own strlcat() function.  See strl.c for details.

 Fixed places were <string.h>, using #ifdef HAVE_STRING_H
 for legacy systems that do not have that include file.

 Added ${H} Makefile symbol to control the announcement
 of forming and having formed hsrc related files.  By default
 H=@ (announce hsrc file formation) vs. H=@: to silence hsrc
 related file formation.

 Explicitly turn off quiet mode (set Makefile variable ${Q} to
 be empty) when building rpms.

 Improved and fixed the hsrc build process.

 Forming rpms is performed in verbose mode to assist debugging
 to the rpm build process.

 Compile custom code, if needed, after main code is compiled.
2021-03-11 01:54:28 -08:00
Landon Curt Noll
c02725f036 Update copyright date to 2021 for all prev typo fixes 2021-02-12 22:27:51 -08:00
Landon Curt Noll
507fe026e5 Fix many spelling errors 2021-02-12 22:09:47 -08:00
Landon Curt Noll
a31078bbec Remove all RCS @(#) lines and RCS strings
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!
2017-05-23 01:33:23 -07:00
Landon Curt Noll
ed4b56d1ec Release calc version 2.12.4.14 2017-05-21 15:38:59 -07:00
Landon Curt Noll
17e3535595 Release calc version 2.12.4.10 2017-05-21 15:38:58 -07:00
Landon Curt Noll
7f125396c1 Release calc version 2.12.4.9 2017-05-21 15:38:57 -07:00
Landon Curt Noll
c9fce6a5bb Release calc version 2.12.4.1 2017-05-21 15:38:56 -07:00
Landon Curt Noll
5bada5fefd Release calc version 2.12.4.6 2017-05-21 15:38:55 -07:00
Landon Curt Noll
ca0dd4560b Release calc version 2.12.2 2017-05-21 15:38:50 -07:00
Landon Curt Noll
c773ee736f Release calc version 2.12.1.11 2017-05-21 15:38:50 -07:00
Landon Curt Noll
ee30d787ea Release calc version 2.12.1.6 2017-05-21 15:38:48 -07:00
Landon Curt Noll
58d94b08d8 Release calc version 2.12.0 2017-05-21 15:38:45 -07:00
Landon Curt Noll
a6a37f9cad Release calc version 2.11.10 2017-05-21 15:38:45 -07:00
Landon Curt Noll
66c3d26611 Release calc version 2.11.9 2017-05-21 15:38:44 -07:00
Landon Curt Noll
3d55811205 Release calc version 2.11.4t2 2017-05-21 15:38:39 -07:00
Landon Curt Noll
296aa50ac7 Release calc version 2.11.2t1 2017-05-21 15:38:38 -07:00
Landon Curt Noll
5e098d2adf Release calc version 2.11.4t1 2017-05-21 15:38:38 -07:00
Landon Curt Noll
ae2a752314 Release calc version 2.11.3t0 2017-05-21 15:38:38 -07:00
Landon Curt Noll
61dd47526f Release calc version 2.11.2t1.0 2017-05-21 15:38:38 -07:00
Landon Curt Noll
6f5e8bf1b6 Release calc version 2.11.1t1 2017-05-21 15:38:36 -07:00
Landon Curt Noll
0514dc0de9 Release calc version 2.11.0t10.5.1 2017-05-21 15:38:36 -07:00
Landon Curt Noll
867002aa77 Release calc version 2.11.1 2017-05-21 15:38:35 -07:00
Landon Curt Noll
96c34adee3 Release calc version 2.11.0t10 2017-05-21 15:38:33 -07:00
Landon Curt Noll
58d32c68f9 Release calc version 2.11.0t9.4.4 2017-05-21 15:38:33 -07:00
Landon Curt Noll
97e9429000 Release calc version 2.11.0t4 2017-05-21 15:38:27 -07:00
Landon Curt Noll
6e10e97592 Release calc version 2.10.3t5.45 2017-05-21 15:38:25 -07:00
Landon Curt Noll
4618313a82 Release calc version 2.10.2t30 2017-05-21 15:38:25 -07:00