Commit Graph

265 Commits

Author SHA1 Message Date
Landon Curt Noll
8374586275 Merge branch 'master' of https://github.com/lcn2/calc 2021-02-02 23:02:24 -08:00
Landon Curt Noll
68c2edf610 Release 2.12.7.4
These changes are per calc version 2.12.7.3:

Requiring calc shell scripts to use -s -f at the end of the
initial #! line.

Fixed /tmp/mersenne example in calc(1) man page.

Added make variable ${ARCH_CFLAGS}.  The ${ARCH_CFLAGS} is
added after ${CCMISC} and before ${EXTRA_CFLAGS} when building
the ${CFLAGS} for compiling C code.  are ${CC} when compiling
C files.  The default value is:

ARCH_CFLAGS= -march=native

which directs C compiler to compile for the native machine.
To disable use of '-march=native', set ARCH_CFLAGS to the empty
string as in:

make all ARCH_CFLAGS=

To make calc RPMs more portable, they are compiled with an
empty ARCH_CFLAGS.

These changes are per calc version 2.12.7.4:

Fixed issues relating to compiling on macOS.  Fixed issues
where <unistd.h> is needed.
2021-02-02 23:01:11 -08:00
Landon Curt Noll
d58a55a1ed Release 2.12.7.3
Requiring calc shell scripts to use -s -f at the end of the
initial #! line.

Fixed /tmp/mersenne example in calc(1) man page.

Added make variable ${ARCH_CFLAGS}.  The ${ARCH_CFLAGS} is
added after ${CCMISC} and before ${EXTRA_CFLAGS} when building
the ${CFLAGS} for compiling C code.  are ${CC} when compiling
C files.  The default value is:

ARCH_CFLAGS= -march=native

which directs C compiler to compile for the native machine.
To disable use of '-march=native', set ARCH_CFLAGS to the empty
string as in:

make all ARCH_CFLAGS=

To make calc RPMs more portable, they are compiled with an
empty ARCH_CFLAGS.

Fixed issues relating to compiling on macOS.  Fixed issues
where <unistd.h> is needed.
2021-02-02 22:54:51 -08:00
Landon Curt Noll
ccfa797b68 Changes as per calc 2.12.7.3 2021-02-02 20:33:59 -08:00
Guilherme Gonzaga de Andrade
0f030f0759 Fix typos; Insert missing lines in README.md
Fixed typos in help/intro and README.md;
Copied missing description lines from help/intro to README.md "What is calc?"
section.
2020-03-03 11:27:23 -04:00
Jack Culhane
af59b9dab2 One FALLTHRU comment was inconsistent with others 2019-05-17 17:31:02 +01:00
Jack Culhane
fa173cd9aa Fix spaces vs tabs and use FALLTHRU as it's used elsewhere 2019-05-17 17:18:07 +01:00
Jack Culhane
1f8269c0e2 Comment fallthrough case statements so compilation succeeds with GCC 7.
GCC 7 Added a warning for implicit fallthroughs in switch cases.
It's enabled by -Wextra, and treated as an error due to -Werror so
compilation fails on GCC 7 and higher.
See -Wimplicit-fallthrough in the GCC manual.
2019-05-17 17:00:48 +01:00
thegithubr
51462b8612 Little fix
A little fix
2019-02-22 13:49:25 +01:00
Landon Curt Noll
9b69648921 Fix long lines in lib_calc.c 2.12.7.2 2018-11-28 12:33:10 -08:00
Landon Curt Noll
c5e416c41f Release calc 2.12.7.2
Fixed a segfault when getpwuid() returned NULL during initialization.
Thanks goes to baratharon GitHub user for reporting this issue.
2018-11-28 12:27:04 -08:00
Landon Curt Noll
37ad43c7fd Release calc 2.12.7.1
Corrected CHANGES notes that were mixed up for TAB, VT, CR &
NL.  The code in 2.12.7.0 is correct.  The CHANGE notes should
have read:

The following is a partial list of escape sequences recognized
in strings and in printf formats:

    \a	audible bell	byte 0x07 in ASCII encoding
    \b	backspace	byte 0x08 in ASCII encoding
    \f	form feed	byte 0x0c in ASCII encoding
    \n	newline		byte 0x0a in ASCII encoding
    \r	return		byte 0x0d in ASCII encoding
    \t	tab		byte 0x09 in ASCII encoding
    \v	vertical tab	byte 0x0b in ASCII encoding

Sorry!
2.12.7.1
2018-11-05 08:02:09 -08:00
Landon Curt Noll
a877cb52c0 Corrected CHANGES notes
Corrected CHANGES notes that were mixed up for TAB, VT, CR & NL.
The core in 2.12.7.0 is correct.  The CHANGE notes were mixed up.
Sorry!
2018-11-05 07:33:40 -08:00
Landon Curt Noll
4bec694df3 Release calc version 2.12.7.0
The following are the changes from calc version 2.12.7.0 to date:

    Added a patch to replaces the manual search for include files
    in $(INCDIR) in the have_*.h targets with compiler invocations.
    Thanks goes to Helmut Grohne (helmut at subdivi dot de) who
    implemented the patch and posted it to the Debian bug tracker
    and Martin Buck (m at rtin-buck dor de) for forwarding it to us.

    The check_include make rule was fixed to not assume /usr/include.

    The qprintnum() function now takes outdigits as a 3rd argument.
    Most of the time, this 3rd argument is just conf->outdigits.
    But when it comes to the experimental '%g', this value can
    change.  This avoids having to modify conf->outdigits.

    Fixed a problem where gcc complains about E_FUNC not being defined
    for Linux systems as reported by Martin Buck (m at rtin-buck dor de).

    Updated the help files help/config, help/display, help/epsilon,
    help/fprint, help/printf, and help/strprintf to give more
    examples of how display digits and epsilon precision interact
    with displaying values.

    Added more information about %g in the help file help/printf.

    The '\a' is now recognized in a printf format string as the
    single byte audible bell character (byte 0x07 in ASCII encoding).

    The following is a partial list of escape sequences recognized
    in strings and in printf formats:

        \a      audible bell    byte 0x07 in ASCII encoding
        \b      backspace       byte 0x08 in ASCII encoding
        \f      form feed       byte 0x0c in ASCII encoding
        \n      newline         byte 0x0b in ASCII encoding
        \r      return          byte 0x0a in ASCII encoding
        \t      tab             byte 0x0d in ASCII encoding
        \v      vertical tab    byte 0x09 in ASCII encoding
2.12.7.0
2018-11-04 17:11:31 -08:00
Landon Curt Noll
4870a7a164 Sync check_include rule with Makefile.ship 2018-11-04 17:10:46 -08:00
Landon Curt Noll
84ccb37bc3 Regualrize escape characters
Regularized the case statements in qio.c, str.c, and token.c
that relate to escape characters.

The '\a' is now recognized in a printf format string as the
single byte audible bell character (byte 0x07 in ASCII encoding).

The following is a partial list of escape sequences recognized
in strings and in printf formats:

    \a      audible bell    byte 0x07 in ASCII encoding
    \b      backspace       byte 0x08 in ASCII encoding
    \f      form feed       byte 0x0c in ASCII encoding
    \n      newline         byte 0x0b in ASCII encoding
    \r      return          byte 0x0a in ASCII encoding
    \t      tab             byte 0x0d in ASCII encoding
    \v      vertical tab    byte 0x09 in ASCII encoding
2018-11-04 17:08:11 -08:00
Landon Curt Noll
29c6e9325f Fix issue with E_FUNC under linux
Fixed a problem where gcc complains about E_FUNC not being defined
for Linux systems as reported by Martin Buck (m at rtin-buck dor de).
2018-11-04 17:01:24 -08:00
Landon Curt Noll
81a4a4f828 Improve string and printing documentation
Updated the help files help/config, help/display, help/epsilon,
help/fprint, help/printf, and help/strprintf to give more
examples of how display digits and epsilon precision interact
with displaying values.

Added more information about %g in the help file help/printf.

The '\a' is now recognized in a printf format string as the
single byte audible bell character (byte 0x07 in ASCII encoding).

The following is a partial list of escape sequences recognized
in strings and in printf formats:

    \a      audible bell    byte 0x07 in ASCII encoding
    \b      backspace       byte 0x08 in ASCII encoding
    \f      form feed       byte 0x0c in ASCII encoding
    \n      newline         byte 0x0b in ASCII encoding
    \r      return          byte 0x0a in ASCII encoding
    \t      tab             byte 0x0d in ASCII encoding
    \v      vertical tab    byte 0x09 in ASCII encoding
2018-11-04 17:00:15 -08:00
Landon Curt Noll
1cdb5172d8 Fix Makefile lines that picky complains about 2.12.6.10 2018-10-19 19:41:58 -07:00
Landon Curt Noll
54a7a3f7bc Release 2.12.6.10
Added a patch to replaces the manual search for include files
    in $(INCDIR) in the have_*.h targets with compiler invocations.
    Thanks goes to Helmut Grohne <helmut at subdivi dot de> who
    implemented the patch and posted it to the Debian bug tracker
    and Martin Buck (m at rtin-buck dor de) for forwarding it to us.

    The check_include make rule was fixed to not assume /usr/include.

    The qprintnum() function now takes outdigits as a 3rd argument.
    Most of the time, this 3rd argument is just conf->outdigits.
    But when it comes to the experimental '%g', this value can
    change.  This avoids having to modify conf->outdigits.
2018-10-19 19:33:57 -07:00
Landon Curt Noll
2ea77e6151 Release 2.12.6.9
Experimental changes for macOS builds.
2.12.6.9
2018-10-15 19:37:48 -07:00
Landon Curt Noll
5cfa6199e5 Merge branch '10110111-master' 2018-09-30 16:11:23 -07:00
Landon Curt Noll
da6ccc146f Improvements to %g pull request
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
2018-09-30 16:06:28 -07:00
Landon Curt Noll
fcfe237375 Merge branch 'master' of https://github.com/10110111/calc into 10110111-master 2018-09-30 14:22:41 -07:00
Landon Curt Noll
5fb3db4558 Fixed trigonometric and hyperbolic core dumps 2018-09-30 14:08:20 -07:00
Landon Curt Noll
c8705c1198 Release calc 2.12.6.8
The following are the changes in this release:

    For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.

    Fixed some compiler warnings, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Added work around for a gcc warning bug, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).

    The calc man page indicates that -d also disables the printing of the
    leading tilde.

    Added information to "help command" about how to silence messages
    while reading calc resource files.

    Fixed an error message buffer overflow thanks to a report by
    Frank Peters <nlp at northernlightsphoto dot biz>.

    Replaced all use of the C funcion sprintf() with snprintf().
    Replaced all use of the C funcion vsprintf() with vsnprintf().
    Replaced all DONT_HAVE_VSPRINTF with DONT_HAVE_VSNPRINTF.
    Replaced all Makefile var ${HAVE_VSPRINTF} with ${HAVE_VSNPRINTF}.
2.12.6.8
2018-09-30 10:25:18 -07:00
Ruslan Kabatsayev
0558bafcb6 Use MODE_REAL_AUTO by default instead of MODE_REAL
This will save the user from embarrassment due to getting
~0.00000000000000000000 as the result instead of e.g. 1.23e-53.
2018-06-30 18:44:14 +03:00
Ruslan Kabatsayev
f58277f53d Implement %g format for printf 2018-06-30 18:35:35 +03:00
Landon Curt Noll
e555a718c0 Released calc 2.12.6.7 with help and input fixes
Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).
k
2.12.6.7
2018-03-04 11:09:09 -08:00
Landon Curt Noll
b29fcf2dd5 Fixed errors in various help files 2018-02-27 18:21:46 -08:00
Landon Curt Noll
4f86703843 Fix long lines 2.12.6.6 2018-02-27 16:16:06 -08:00
Landon Curt Noll
07d8bf0f3e Version 2.12.6.6 2018-02-21 12:38:39 -08:00
Landon Curt Noll
b4cd692bae Fixed compiler warnings
Fixed some compiler warnings.
Added work around for a gcc warning bug.
2018-02-21 12:37:46 -08:00
Landon Curt Noll
83c898cc2b Improved how lucas.cal pre-verifies numbers 2018-02-21 12:36:21 -08:00
Landon Curt Noll
c585d7aa78 Release calc version 2.12.6.5 2.12.6.5 2018-01-28 18:26:08 -08:00
Landon Curt Noll
f42a003d04 Improve formatting of comments in cal/lucas.cal 2.12.6.4 2018-01-16 15:33:00 -08:00
Landon Curt Noll
8da0471f07 Release calc version 2.12.6.4
Fixed a man page warning about ./myfile where the leading dot
was mistook for an nroff macro.  Thanks goes to David Haller
<dnh at opensuse dot org> for providing the patch.

Improved gen_v1(h,n) in lucas.cal for cases where h is not a
multiple of 3. Optimized the search for v(1) when h is a
multiple of 3.

Fixed a Makefile problem, reported by Doug Hays <doughays6 at gmail
dot com>, where if a macOS user set BINDIR, LIBDIR, CALC_SHAREDIR
or INCDIR in the top section, their values will be overwritten by
the Darwin specific section.
2018-01-16 15:27:13 -08:00
Landon Curt Noll
1c20261b93 Fixed macro warning about ./myfile 2017-09-07 14:28:54 -07:00
Landon Curt Noll
aeb9a9d473 Prepare for calc version 2.12.6.3 2.12.6.3 2017-09-06 18:20:35 -07:00
Landon Curt Noll
66883b390d Fixed CHANGES typo 2017-09-06 18:11:35 -07:00
Landon Curt Noll
ea533659ce Release calc version 2.12.6.2 2.12.6.2 2017-09-06 17:42:41 -07:00
Landon Curt Noll
9e81971f25 Verify that h*2^n-1 is not a multiple of 3 2017-09-06 17:41:56 -07:00
Landon Curt Noll
cbbd866535 Fixed a misleading indent reported by Thomas Walter 2017-09-06 17:40:49 -07:00
Landon Curt Noll
bf23f82c29 Correct comments relating to v(1) search table 2017-06-18 08:11:43 -07:00
Landon Curt Noll
ec5c584785 Fixed typo in lucas.cal comment 2017-06-18 04:11:44 -07:00
Landon Curt Noll
6bbb8c0e42 Update v(1) stats with full 1000000 test sample 2017-06-18 03:50:28 -07:00
Landon Curt Noll
438554b0ed Make a minor speedup to gen_v1(h,n) in lucas.cal 2017-06-14 16:50:58 -07:00
Landon Curt Noll
61ba4bc5c8 Improve lucas.cal v(1) search method & remarks 2.12.6.1 2017-06-14 16:30:42 -07:00
Landon Curt Noll
0145883396 Improved lucas.cal vt tables and arg checking 2017-06-09 15:44:48 -07:00
Landon Curt Noll
f91bfaab70 Prep for calc version 2.12.6.1 2017-06-05 21:05:25 -07:00