mirror of
https://github.com/lcn2/calc.git
synced 2025-08-22 01:23:28 +03:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
85bfa30897 | ||
|
17e3535595 | ||
|
7f125396c1 | ||
|
7cf611bca8 | ||
|
c9fce6a5bb | ||
|
a1c96f95a6 | ||
|
5e6b3cbd3f |
8
BUGS
8
BUGS
@@ -84,7 +84,7 @@ Problems that have known work-a-rounds:
|
|||||||
|
|
||||||
mis-features in calc:
|
mis-features in calc:
|
||||||
|
|
||||||
Some problems are not bugs but rarther mis-features / things that could
|
Some problems are not bugs but rather mis-features / things that could
|
||||||
work better. The following is a list of mis-features that should be
|
work better. The following is a list of mis-features that should be
|
||||||
addressed and improved someday.
|
addressed and improved someday.
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ mis-features in calc:
|
|||||||
|
|
||||||
will not.
|
will not.
|
||||||
|
|
||||||
## Copyright (C) 1999-2007 Landon Curt Noll
|
## Copyright (C) 1999-2013 Landon Curt Noll
|
||||||
##
|
##
|
||||||
## Calc is open software; you can redistribute it and/or modify it under
|
## Calc is open software; you can redistribute it and/or modify it under
|
||||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -145,8 +145,8 @@ mis-features in calc:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.2 $
|
||||||
## @(#) $Id: BUGS,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
## @(#) $Id: BUGS,v 30.2 2013/08/11 01:09:27 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $
|
## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/18 14:06:13
|
## Under source code control: 1994/03/18 14:06:13
|
||||||
|
144
CHANGES
144
CHANGES
@@ -1,10 +1,128 @@
|
|||||||
The following are the changes from calc version 2.12.4.6 to date:
|
The following are the changes from calc version 2.12.4.11 to date:
|
||||||
|
|
||||||
|
Fixed many typos in comments of the Makefile thanks to the review
|
||||||
|
work of Michael Somos <somos at harary dot math dot georgetown dot edu>.
|
||||||
|
|
||||||
|
Fixed typo in "help sysinfo".
|
||||||
|
|
||||||
|
The Makefile rule, debug, is now more verbose and prints more information
|
||||||
|
about the calc compiled constants.
|
||||||
|
|
||||||
|
Added a more of calc resource files by
|
||||||
|
Christoph Zurnieden <czurnieden at gmx dot de> including:
|
||||||
|
|
||||||
|
infinities.cal - handle infinities symbolically, a little helper file
|
||||||
|
intnum.cal - implementation of tanhsinh- and Gauss-Legendre quadrature
|
||||||
|
smallfactors.cal - find the factors of a number < 2^32
|
||||||
|
strings.cal - implementation of the macros in ctype.h plus str[n]casecmp
|
||||||
|
|
||||||
|
Reformatted some calc resource files. Cleanup in comment the headers
|
||||||
|
of some calc resource files.
|
||||||
|
|
||||||
|
Minor formatting changes to a few help files.
|
||||||
|
|
||||||
|
No need to be special picky about the test8900.cal calc resource file.
|
||||||
|
|
||||||
|
Added a number of ctype-like builtins:
|
||||||
|
|
||||||
|
isalnum - whether character is alpha-numeric
|
||||||
|
isalpha - whether character is alphabetic
|
||||||
|
iscntrl - whether character is a control character
|
||||||
|
isdigit - whether character is a digit character
|
||||||
|
isgraph - whether character is a graphical character
|
||||||
|
islower - whether character is lower case
|
||||||
|
isprint - whether character is a printable
|
||||||
|
ispunct - whether character is a punctuation
|
||||||
|
isspace - whether character is a space character
|
||||||
|
isupper - whether character is upper case
|
||||||
|
isxdigit - whether character a hexadecimal digit
|
||||||
|
strcasecmp - compare two strings, case independent
|
||||||
|
strncasecmp - compare two strings up to n characters, case independent
|
||||||
|
|
||||||
|
For details on these new builtins, see their help messages.
|
||||||
|
Thanks goes to Inge Zurnieden <inge dot zurnieden at gmx dot de> for
|
||||||
|
these new builtins.
|
||||||
|
|
||||||
|
Calc source code is now picky v2.3 clean using:
|
||||||
|
|
||||||
|
picky -s -v file file2 ..
|
||||||
|
|
||||||
|
With the exception of:
|
||||||
|
|
||||||
|
help/errorcodes.sed
|
||||||
|
cal/set8700.line
|
||||||
|
|
||||||
|
Due to the long lines in those files, we use:
|
||||||
|
|
||||||
|
picky -w -s -v help/errorcodes.sed cal/set8700.line
|
||||||
|
|
||||||
|
For more information about the picky tool, see:
|
||||||
|
|
||||||
|
http://cis.csuohio.edu/~somos/picky.html
|
||||||
|
|
||||||
|
|
||||||
|
The following are the changes from calc version 2.12.4.6 to version 2.12.4.10:
|
||||||
|
|
||||||
Updated RPM build process to remove use of deprecated flags.
|
Updated RPM build process to remove use of deprecated flags.
|
||||||
|
|
||||||
Applied a number of fixes calc.spec file.
|
Applied a number of fixes to calc.spec and rpm.mk file.
|
||||||
|
See calc.spec.in for details. Changed rpm release to 2.1.
|
||||||
|
|
||||||
Changed rpm release to 2.1.
|
Set MACOSX_DEPLOYMENT_TARGET=10.8 as we upgraded all of
|
||||||
|
our development Mac OS X to 10.8.
|
||||||
|
|
||||||
|
Libraries are chmodded as 0644 to allow for building rpms
|
||||||
|
without root.
|
||||||
|
|
||||||
|
Silenced annoying warning about unused variable 'intp'
|
||||||
|
while compiline endian.c under some circumstances.
|
||||||
|
|
||||||
|
Fixed typo in redeclaration warnings. Thanks to
|
||||||
|
Christoph Zurnieden <czurnieden at gmx dot de> for this report.
|
||||||
|
|
||||||
|
Added a number of calc resource files by
|
||||||
|
Christoph Zurnieden <czurnieden at gmx dot de> including:
|
||||||
|
|
||||||
|
bernpoly.cal - Computes the nth Bernoulli polynomial at z for any n,z
|
||||||
|
brentsolve.cal - root-finder implementwed with the Brent-Dekker trick
|
||||||
|
factorial.cal - product of the positive integers
|
||||||
|
factorial2.cal - variety of integer functions quasi-related to factoral
|
||||||
|
lambertw.cal - Computes Lambert's W-function at "z" at branch "branch"
|
||||||
|
lnseries.cal - Calculates a series of natural logarithms at 1,2,3,4...n
|
||||||
|
specialfunctions.cal - Calculates the value of the beta function
|
||||||
|
statistics.cal - a wide vareity of stastical functions
|
||||||
|
toomcook.cal - Multiply by way of the Toom-Cook algorithm
|
||||||
|
zeta2.cal - Calculate the value of the Hurwitz Zeta function
|
||||||
|
|
||||||
|
Fixed a makefile bug that prevented the those new calc resource
|
||||||
|
files from being installed.
|
||||||
|
|
||||||
|
Improved the formatting of the output from:
|
||||||
|
|
||||||
|
help resource
|
||||||
|
|
||||||
|
We replaced COPYING-LGPL with the version that is found at
|
||||||
|
http://www.gnu.org/licenses/lgpl-2.1.txt because that version
|
||||||
|
contans some whitespace formatting cleanup. Otherwise the
|
||||||
|
license is the same.
|
||||||
|
|
||||||
|
We fixed a number of places where "the the" was used
|
||||||
|
when just "the" should be used.
|
||||||
|
|
||||||
|
NOTE: Fixes to grammar, spelling and minor formatting
|
||||||
|
problems are welcome. Please send us your patches!
|
||||||
|
|
||||||
|
With the exception of 3 source files, we became "picky" about
|
||||||
|
line lengths and other issues reported by the picky tool:
|
||||||
|
|
||||||
|
cal/test8900.cal
|
||||||
|
cal/set8700.line
|
||||||
|
help/errorcodes.sed
|
||||||
|
|
||||||
|
The above 3 files now pass picky -w (OK except for line length).
|
||||||
|
For more information about the picky tool, see:
|
||||||
|
|
||||||
|
http://cis.csuohio.edu/~somos/picky.html
|
||||||
|
|
||||||
|
|
||||||
The following are the changes from calc version 2.12.4.3 to 2.12.4.5:
|
The following are the changes from calc version 2.12.4.3 to 2.12.4.5:
|
||||||
@@ -2117,7 +2235,7 @@ The following are the changes from calc version 2.11.1 to 2.11.1t2.2:
|
|||||||
Cleaned up help display system. Help file lines that begin with
|
Cleaned up help display system. Help file lines that begin with
|
||||||
'##' are not displayed.
|
'##' are not displayed.
|
||||||
|
|
||||||
Calc source and documentation now uses the the these terms:
|
Calc source and documentation now uses these terms:
|
||||||
|
|
||||||
*.cal files calc resource file
|
*.cal files calc resource file
|
||||||
*.a files calc binary link library
|
*.a files calc binary link library
|
||||||
@@ -2155,7 +2273,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11:
|
|||||||
Fixed whitespace to make the best use of 8 character tabs.
|
Fixed whitespace to make the best use of 8 character tabs.
|
||||||
|
|
||||||
Fixed some bugs relating to '// and %' in combination with some
|
Fixed some bugs relating to '// and %' in combination with some
|
||||||
of the the rounding modes based on a patch from Ernest Bowen
|
of the rounding modes based on a patch from Ernest Bowen
|
||||||
<ernie at turing dot une dot edu dot au>.
|
<ernie at turing dot une dot edu dot au>.
|
||||||
|
|
||||||
A patch from Klaus Alexander Seistrup <klaus at seistrup dot dk>, when
|
A patch from Klaus Alexander Seistrup <klaus at seistrup dot dk>, when
|
||||||
@@ -2349,7 +2467,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11:
|
|||||||
|
|
||||||
Where ``/usr/local/bin/calc'' is the path to the calc binary.
|
Where ``/usr/local/bin/calc'' is the path to the calc binary.
|
||||||
Additional -options may be added to the line, but it MUST
|
Additional -options may be added to the line, but it MUST
|
||||||
start with -S. For example, the the executable file ``plus''
|
start with -S. For example, the executable file ``plus''
|
||||||
contain the following:
|
contain the following:
|
||||||
|
|
||||||
#!/usr/local/bin/calc -S -e
|
#!/usr/local/bin/calc -S -e
|
||||||
@@ -4812,7 +4930,7 @@ The following are the changes from calc version 2.10.3t0 to 2.10.3t2:
|
|||||||
|
|
||||||
global variable: to the end of the session with calc
|
global variable: to the end of the session with calc
|
||||||
|
|
||||||
static within a function definition: to the the first of:
|
static within a function definition: to the first of:
|
||||||
|
|
||||||
an end of a global, static or local declaration (including
|
an end of a global, static or local declaration (including
|
||||||
initialization code) with the same identifier
|
initialization code) with the same identifier
|
||||||
@@ -4910,7 +5028,7 @@ The following are the changes from calc version 2.10.3t0 to 2.10.3t2:
|
|||||||
|
|
||||||
global a, b, mat A, B[2] = {3,4}, C[2] = {4,5}, obj point P = {5,6}, Q
|
global a, b, mat A, B[2] = {3,4}, C[2] = {4,5}, obj point P = {5,6}, Q
|
||||||
|
|
||||||
Fixed some bugs related to global and static scoping. See the the
|
Fixed some bugs related to global and static scoping. See the
|
||||||
5200 regress test and lib/test5200.cal for details.
|
5200 regress test and lib/test5200.cal for details.
|
||||||
|
|
||||||
Optimized opcode generator so that functions defined using '=' do not
|
Optimized opcode generator so that functions defined using '=' do not
|
||||||
@@ -5407,7 +5525,7 @@ The following are the changes from calc version 2.10.2t4 to 2.10.2t24:
|
|||||||
ILDFLAGS are flags given to ${CC} for linking .o files
|
ILDFLAGS are flags given to ${CC} for linking .o files
|
||||||
for intermediate progs
|
for intermediate progs
|
||||||
|
|
||||||
CC is how the the C compiler is invoked
|
CC is how the C compiler is invoked
|
||||||
|
|
||||||
Added more tests to regress.cal.
|
Added more tests to regress.cal.
|
||||||
|
|
||||||
@@ -5632,7 +5750,7 @@ The following are the changes from calc version 2.10.2t1 to 2.10.2t3:
|
|||||||
Some systems has a libc symbolic qadd() that conflicted with calc's
|
Some systems has a libc symbolic qadd() that conflicted with calc's
|
||||||
qadd function. To avoid this, qadd() has been renamed to qqadd().
|
qadd function. To avoid this, qadd() has been renamed to qqadd().
|
||||||
|
|
||||||
The calc error codes are produced from the the calcerr.tbl file.
|
The calc error codes are produced from the calcerr.tbl file.
|
||||||
Instead of changing #defines in value.h, one can not edit calcerr.tbl.
|
Instead of changing #defines in value.h, one can not edit calcerr.tbl.
|
||||||
The Makefile builds calcerr.h from this file.
|
The Makefile builds calcerr.h from this file.
|
||||||
|
|
||||||
@@ -6175,7 +6293,7 @@ The following are the changes from calc version 2.9.3t11 to 2.10.0t12:
|
|||||||
LDFLAGS are flags given to ${CC} for linking .o files
|
LDFLAGS are flags given to ${CC} for linking .o files
|
||||||
ILDFLAGS are given to ${CC} for linking .o's for intermediate progs
|
ILDFLAGS are given to ${CC} for linking .o's for intermediate progs
|
||||||
|
|
||||||
CC is how the the C compiler is invoked
|
CC is how the C compiler is invoked
|
||||||
|
|
||||||
The syntax error:
|
The syntax error:
|
||||||
|
|
||||||
@@ -6826,8 +6944,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.24 $
|
## @(#) $Revision: 30.33 $
|
||||||
## @(#) $Id: CHANGES,v 30.24 2013/05/05 08:31:08 chongo Exp $
|
## @(#) $Id: CHANGES,v 30.33 2013/09/01 22:19:41 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
|
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1993/06/02 18:12:57
|
## Under source code control: 1993/06/02 18:12:57
|
||||||
|
17
COPYING
17
COPYING
@@ -12,11 +12,11 @@ This file is Copyrighted
|
|||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
# @(#) $Revision: 30.2 $
|
# @(#) $Revision: 30.4 $
|
||||||
# @(#) $Id: COPYING,v 30.2 2008/10/24 10:46:52 chongo Exp $
|
# @(#) $Id: COPYING,v 30.4 2013/09/01 20:14:30 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $
|
# @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
Calc is covered by the GNU Lesser General Public License
|
Calc is covered by the GNU Lesser General Public License
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
@@ -78,7 +78,7 @@ Calc is covered by the GNU Lesser General Public License
|
|||||||
|
|
||||||
Feel free to follow the name line with additional EMail text as desired.
|
Feel free to follow the name line with additional EMail text as desired.
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
Calc bug reports and calc bug fixes should be sent to:
|
Calc bug reports and calc bug fixes should be sent to:
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ Calc is covered by the GNU Lesser General Public License
|
|||||||
|
|
||||||
You may have additional words in your subject line.
|
You may have additional words in your subject line.
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
Calc's relationship to the GNU Lesser General Public License
|
Calc's relationship to the GNU Lesser General Public License
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
@@ -149,7 +149,7 @@ Calc's relationship to the GNU Lesser General Public License
|
|||||||
except for the exception files explicitly listed in the ``Calc
|
except for the exception files explicitly listed in the ``Calc
|
||||||
copyrights and exception files'' section below.
|
copyrights and exception files'' section below.
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
Calc copyrights and exception files
|
Calc copyrights and exception files
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
@@ -165,6 +165,7 @@ Calc copyrights and exception files
|
|||||||
Copyright (C) year Ernest Bowen and Landon Curt Noll
|
Copyright (C) year Ernest Bowen and Landon Curt Noll
|
||||||
Copyright (C) year Ernest Bowen
|
Copyright (C) year Ernest Bowen
|
||||||
Copyright (C) year Petteri Kettunen and Landon Curt Noll
|
Copyright (C) year Petteri Kettunen and Landon Curt Noll
|
||||||
|
Copyright (C) year Christoph Zurnieden
|
||||||
|
|
||||||
These files are not covered under one of the Copyrights listed above:
|
These files are not covered under one of the Copyrights listed above:
|
||||||
|
|
||||||
@@ -188,7 +189,7 @@ Calc copyrights and exception files
|
|||||||
And because one may freely distribute the LGPL covered files, the
|
And because one may freely distribute the LGPL covered files, the
|
||||||
entire calc source may be freely used and distributed.
|
entire calc source may be freely used and distributed.
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
General Copyleft and License info
|
General Copyleft and License info
|
||||||
---------------------------------
|
---------------------------------
|
||||||
@@ -202,7 +203,7 @@ General Copyleft and License info
|
|||||||
http://www.gnu.org/copyleft/lesser.html
|
http://www.gnu.org/copyleft/lesser.html
|
||||||
http://www.gnu.org/copyleft/lesser.txt
|
http://www.gnu.org/copyleft/lesser.txt
|
||||||
|
|
||||||
=-=
|
-=-
|
||||||
|
|
||||||
Why calc did not use the GNU General Public License
|
Why calc did not use the GNU General Public License
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
21
COPYING-LGPL
21
COPYING-LGPL
@@ -1,8 +1,8 @@
|
|||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
Version 2.1, February 1999
|
Version 2.1, February 1999
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
as the successor of the GNU Library Public License, version 2, hence
|
as the successor of the GNU Library Public License, version 2, hence
|
||||||
the version number 2.1.]
|
the version number 2.1.]
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The licenses for most software are designed to take away your
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
@@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
|
|||||||
former contains code derived from the library, whereas the latter must
|
former contains code derived from the library, whereas the latter must
|
||||||
be combined with the library in order to run.
|
be combined with the library in order to run.
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
0. This License Agreement applies to any software library or other
|
||||||
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
|||||||
on the Library (independent of the use of the Library in a tool for
|
on the Library (independent of the use of the Library in a tool for
|
||||||
writing it). Whether that is true depends on what the Library does
|
writing it). Whether that is true depends on what the Library does
|
||||||
and what the program that uses the Library does.
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
complete source code as you receive it, in any medium, provided that
|
complete source code as you receive it, in any medium, provided that
|
||||||
you conspicuously and appropriately publish on each copy an
|
you conspicuously and appropriately publish on each copy an
|
||||||
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
|
|||||||
of all derivatives of our free software and of promoting the sharing
|
of all derivatives of our free software and of promoting the sharing
|
||||||
and reuse of software generally.
|
and reuse of software generally.
|
||||||
|
|
||||||
NO WARRANTY
|
NO WARRANTY
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
DAMAGES.
|
DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
How to Apply These Terms to Your New Libraries
|
||||||
|
|
||||||
@@ -485,7 +485,8 @@ convey the exclusion of warranty; and each file should have at least the
|
|||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
|
USA
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
@@ -500,5 +501,3 @@ necessary. Here is a sample; alter the names:
|
|||||||
Ty Coon, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
That's all there is to it!
|
That's all there is to it!
|
||||||
|
|
||||||
|
|
||||||
|
330
Makefile
330
Makefile
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
# Gnu makefile: # This is a Gnu make makefile. If your make does not #
|
# Gnu makefile: # This is a Gnu make makefile. If your make does not #
|
||||||
# Gnu makefile: # understand this makefilkke format, then edit and use #
|
# Gnu makefile: # understand this makefile format, then edit and use #
|
||||||
# Gnu makefile: # Makefile.simple instead of this Makefile. #
|
# Gnu makefile: # Makefile.simple instead of this Makefile. #
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
#
|
#
|
||||||
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
|
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
|
||||||
# Makefile for the people who build calc from the bzip2-ed tarball.
|
# Makefile for the people who build calc from the bzip2-ed tarball.
|
||||||
# Without modification, it not assume the system has readline, ncurses
|
# Without modification, it does not assume the system has readline,
|
||||||
# or less. It compiles with gcc -O3 -g3 as well. You can change all
|
# ncurses or less. It compiles with gcc -O3 -g3 as well. You can
|
||||||
# this by modifying the Makefile variables below.
|
# change all this by modifying the Makefile variables below.
|
||||||
#
|
#
|
||||||
# NOTE: You might want use the READLINE facility if your system
|
# NOTE: You might want use the READLINE facility if your system
|
||||||
# has the GNU readline headers and libaraies:
|
# has the GNU readline headers and libraries:
|
||||||
#
|
#
|
||||||
# USE_READLINE= -DUSE_READLINE
|
# USE_READLINE= -DUSE_READLINE
|
||||||
# READLINE_LIB= -lreadline
|
# READLINE_LIB= -lreadline
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# Copyright (C) 1999-2008 Landon Curt Noll
|
# Copyright (C) 1999-2008 Landon Curt Noll
|
||||||
#
|
#
|
||||||
# Calc is open software; you can redistribute it and/or modify it under
|
# Calc is open software; you can redistribute it and/or modify it under
|
||||||
# the terms of the version 2.1 of the GNU Lesser General Public License
|
# the terms of version 2.1 of the GNU Lesser General Public License
|
||||||
# as published by the Free Software Foundation.
|
# as published by the Free Software Foundation.
|
||||||
#
|
#
|
||||||
# Calc is distributed in the hope that it will be useful, but WITHOUT
|
# Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
MAKEFILE_REV= $$Revision: 30.49 $$
|
MAKEFILE_REV= $$Revision: 30.58 $$
|
||||||
# @(#) $Id: Makefile.ship,v 30.49 2013/03/25 21:31:55 chongo Exp chongo $
|
# @(#) $Id: Makefile.ship,v 30.58 2013/08/18 20:36:50 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
|
# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1990/02/15 01:48:41
|
# Under source code control: 1990/02/15 01:48:41
|
||||||
@@ -61,7 +61,7 @@ MAKEFILE_REV= $$Revision: 30.49 $$
|
|||||||
#
|
#
|
||||||
# make ...__optional_arguments_... target=value
|
# make ...__optional_arguments_... target=value
|
||||||
|
|
||||||
# Try uname -s if the target was not alreadhy set on the make command line
|
# Try uname -s if the target was not already set on the make command line
|
||||||
#
|
#
|
||||||
ifeq ($(target),)
|
ifeq ($(target),)
|
||||||
target=$(shell uname -s 2>/dev/null)
|
target=$(shell uname -s 2>/dev/null)
|
||||||
@@ -101,13 +101,13 @@ TERMCONTROL=
|
|||||||
# If you do not have vsprintf(), then calc will try sprintf() and hope
|
# If you do not have vsprintf(), then calc will try sprintf() and hope
|
||||||
# for the best.
|
# for the best.
|
||||||
#
|
#
|
||||||
# A simular problem occurs if your system does not have a vsnprintf()
|
# A similar problem occurs if your system does not have a vsnprintf()
|
||||||
# function. This function is like the vsprintf() function except that
|
# function. This function is like the vsprintf() function except that
|
||||||
# there is an extra second argument that controls the maximum size
|
# there is an extra second argument that controls the maximum size
|
||||||
# string that is produced.
|
# string that is produced.
|
||||||
#
|
#
|
||||||
# If HAVE_VSPRINTF is empty, this Makefile will run the have_stdvs.c and/or
|
# If HAVE_VSPRINTF is empty, this Makefile will run the have_stdvs.c and/or
|
||||||
# have_varvs.c program to determine if vsprintf() is supported. If
|
# have_varvs.c program to determine if vsprintf() is supported. If
|
||||||
# HAVE_VSPRINTF is set to -DDONT_HAVE_VSPRINTF then calc will hope that
|
# HAVE_VSPRINTF is set to -DDONT_HAVE_VSPRINTF then calc will hope that
|
||||||
# sprintf() will work.
|
# sprintf() will work.
|
||||||
#
|
#
|
||||||
@@ -243,13 +243,13 @@ INODE_BITS=
|
|||||||
#INODE_BITS= 64
|
#INODE_BITS= 64
|
||||||
|
|
||||||
# Determine if we have an off_t which one can perform arithmetic operations,
|
# Determine if we have an off_t which one can perform arithmetic operations,
|
||||||
# assignments and comparisons. On some systems off_t is some sort of union
|
# assignments and comparisons. On some systems off_t is some sort of union
|
||||||
# or struct.
|
# or struct.
|
||||||
#
|
#
|
||||||
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
|
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
|
||||||
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
|
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
|
||||||
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
|
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
|
||||||
# union or struct which.
|
# union or struct.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -257,7 +257,7 @@ HAVE_OFFSCL=
|
|||||||
#HAVE_OFFSCL= -DOFF_T_NON_SCALAR
|
#HAVE_OFFSCL= -DOFF_T_NON_SCALAR
|
||||||
|
|
||||||
# Determine if we have an fpos_t which one can perform arithmetic operations,
|
# Determine if we have an fpos_t which one can perform arithmetic operations,
|
||||||
# assignments and comparisons. On some systems fpos_t is some sort of union
|
# assignments and comparisons. On some systems fpos_t is some sort of union
|
||||||
# or struct. Some systems do not have an fpos_t and long is as a file
|
# or struct. Some systems do not have an fpos_t and long is as a file
|
||||||
# offset instead.
|
# offset instead.
|
||||||
#
|
#
|
||||||
@@ -265,7 +265,7 @@ HAVE_OFFSCL=
|
|||||||
# to determine if off_t is a scalar, or if there is no off_t and long
|
# to determine if off_t is a scalar, or if there is no off_t and long
|
||||||
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value
|
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value
|
||||||
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
|
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
|
||||||
# some sort of union or struct which.
|
# some sort of union or struct.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -286,7 +286,7 @@ HAVE_CONST=
|
|||||||
# Determine if we have uid_t
|
# Determine if we have uid_t
|
||||||
#
|
#
|
||||||
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
|
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
|
||||||
# to determine if const is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
|
# to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
|
||||||
# then calc will treat uid_t as an unsigned short. This only matters if
|
# then calc will treat uid_t as an unsigned short. This only matters if
|
||||||
# $HOME is not set and calc must look up the home directory in /etc/passwd.
|
# $HOME is not set and calc must look up the home directory in /etc/passwd.
|
||||||
#
|
#
|
||||||
@@ -313,7 +313,7 @@ HAVE_NEWSTR=
|
|||||||
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
|
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
|
||||||
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to
|
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to
|
||||||
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
|
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the memory move function that does correct overlapping memory moves.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -322,10 +322,10 @@ HAVE_MEMMOVE=
|
|||||||
|
|
||||||
# Determine if we have ustat()
|
# Determine if we have ustat()
|
||||||
#
|
#
|
||||||
# If HAVE_USTAT is empty, this Makefile will run the have_memmv program
|
# If HAVE_USTAT is empty, this Makefile will run the have_ustat program
|
||||||
# to determine if ustat() is supported. If HAVE_USTAT is set to
|
# to determine if ustat() is supported. If HAVE_USTAT is set to
|
||||||
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate
|
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the ustat() function that gets file system statistics.
|
||||||
#
|
#
|
||||||
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
|
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -336,10 +336,10 @@ HAVE_USTAT=
|
|||||||
|
|
||||||
# Determine if we have getsid()
|
# Determine if we have getsid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETSID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETSID is empty, this Makefile will run the have_getsid program
|
||||||
# to determine if getsid() is supported. If HAVE_GETSID is set to
|
# to determine if getsid() is supported. If HAVE_GETSID is set to
|
||||||
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getsid() function that gets session ID.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
|
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -350,10 +350,10 @@ HAVE_GETSID=
|
|||||||
|
|
||||||
# Determine if we have getpgid()
|
# Determine if we have getpgid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETPGID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program
|
||||||
# to determine if getpgid() is supported. If HAVE_GETPGID is set to
|
# to determine if getpgid() is supported. If HAVE_GETPGID is set to
|
||||||
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getpgid() function that sets the process group ID.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
|
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -364,10 +364,10 @@ HAVE_GETPGID=
|
|||||||
|
|
||||||
# Determine if we have clock_gettime()
|
# Determine if we have clock_gettime()
|
||||||
#
|
#
|
||||||
# If HAVE_GETTIME is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETTIME is empty, this Makefile will run the have_gettime program
|
||||||
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
|
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
|
||||||
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the clock_gettime() function.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
|
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -378,10 +378,10 @@ HAVE_GETTIME=
|
|||||||
|
|
||||||
# Determine if we have getprid()
|
# Determine if we have getprid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETPRID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETPRID is empty, this Makefile will run the have_getprid program
|
||||||
# to determine if getprid() is supported. If HAVE_GETPRID is set to
|
# to determine if getprid() is supported. If HAVE_GETPRID is set to
|
||||||
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getprid() function.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
|
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -392,7 +392,7 @@ HAVE_GETPRID=
|
|||||||
|
|
||||||
# Determine if we have the /dev/urandom
|
# Determine if we have the /dev/urandom
|
||||||
#
|
#
|
||||||
# HAVE_URANDOM_H= let the Makefile look /dev/urandom
|
# HAVE_URANDOM_H= let the Makefile look for /dev/urandom
|
||||||
# HAVE_URANDOM_H= YES assume that /dev/urandom exists
|
# HAVE_URANDOM_H= YES assume that /dev/urandom exists
|
||||||
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
|
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
|
||||||
#
|
#
|
||||||
@@ -406,10 +406,10 @@ HAVE_URANDOM_H=
|
|||||||
|
|
||||||
# Determine if we have getrusage()
|
# Determine if we have getrusage()
|
||||||
#
|
#
|
||||||
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program
|
||||||
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
|
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
|
||||||
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getrusage() function.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -418,10 +418,10 @@ HAVE_GETRUSAGE=
|
|||||||
|
|
||||||
# Determine if we have strdup()
|
# Determine if we have strdup()
|
||||||
#
|
#
|
||||||
# If HAVE_STRDUP is empty, this Makefile will run the have_memmv program
|
# If HAVE_STRDUP is empty, this Makefile will run the have_strdup program
|
||||||
# to determine if strdup() is supported. If HAVE_STRDUP is set to
|
# to determine if strdup() is supported. If HAVE_STRDUP is set to
|
||||||
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
|
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the strdup() function.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -429,10 +429,10 @@ HAVE_STRDUP=
|
|||||||
#HAVE_STRDUP= -DHAVE_NO_STRDUP
|
#HAVE_STRDUP= -DHAVE_NO_STRDUP
|
||||||
|
|
||||||
# Some architectures such as Sparc do not allow one to access 32 bit values
|
# Some architectures such as Sparc do not allow one to access 32 bit values
|
||||||
# that are not alligned on a 32 bit boundary.
|
# that are not aligned on a 32 bit boundary.
|
||||||
#
|
#
|
||||||
# The Dec Alpha running OSF/1 will produce alignment error messages when
|
# The Dec Alpha running OSF/1 will produce alignment error messages when
|
||||||
# align32.c tries to figure out if alignment is needed. Use the
|
# align32.c tries to figure out if alignment is needed. Use the
|
||||||
# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages.
|
# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages.
|
||||||
#
|
#
|
||||||
# ALIGN32= let align32.c figure out if alignment is needed
|
# ALIGN32= let align32.c figure out if alignment is needed
|
||||||
@@ -587,7 +587,7 @@ HAVE_UNUSED=
|
|||||||
#INCDIR= /dev/env/DJDIR/include
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
INCDIR= /usr/include
|
INCDIR= /usr/include
|
||||||
|
|
||||||
# Where to install calc realted things
|
# Where to install calc related things
|
||||||
#
|
#
|
||||||
# ${BINDIR} where to install calc binary files
|
# ${BINDIR} where to install calc binary files
|
||||||
# ${LIBDIR} where calc link library (*.a) files are installed
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
@@ -672,7 +672,7 @@ SCRIPTDIR= ${BINDIR}/cscript
|
|||||||
# T - top level directory under which calc will be installed
|
# T - top level directory under which calc will be installed
|
||||||
#
|
#
|
||||||
# The calc install is performed under ${T}, the calc build is
|
# The calc install is performed under ${T}, the calc build is
|
||||||
# performed under /. The purpose for ${T} is to allow someone
|
# performed under /. The purpose for ${T} is to allow someone
|
||||||
# to install calc somewhere other than into the system area.
|
# to install calc somewhere other than into the system area.
|
||||||
#
|
#
|
||||||
# For example, if:
|
# For example, if:
|
||||||
@@ -690,7 +690,7 @@ SCRIPTDIR= ${BINDIR}/cscript
|
|||||||
# calc binary files: /var/tmp/testing/usr/bin
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
# calc link library: /var/tmp/testing/usr/lib
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
# ... etc ... /var/tmp/testing/...
|
# ... etc ... /var/tmp/testing/...
|
||||||
#
|
#
|
||||||
# If ${T} is empty, calc is installed under /, which is the same
|
# If ${T} is empty, calc is installed under /, which is the same
|
||||||
# top of tree for which it was built. If ${T} is non-empty, then
|
# top of tree for which it was built. If ${T} is non-empty, then
|
||||||
@@ -754,12 +754,12 @@ CATEXT= 1
|
|||||||
# If NROFF is non-empty, then
|
# If NROFF is non-empty, then
|
||||||
#
|
#
|
||||||
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
|
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
|
||||||
# is used to built and install the cat page
|
# is used to build and install the cat page
|
||||||
#
|
#
|
||||||
# else (NROFF is empty)
|
# else (NROFF is empty)
|
||||||
#
|
#
|
||||||
# ${MANMAKE} calc.1 ${CATDIR}
|
# ${MANMAKE} calc.1 ${CATDIR}
|
||||||
# is used to built and install the cat page
|
# is used to build and install the cat page
|
||||||
# else
|
# else
|
||||||
#
|
#
|
||||||
# The cat page is not built or installed
|
# The cat page is not built or installed
|
||||||
@@ -782,8 +782,8 @@ CATMODE= 0444
|
|||||||
|
|
||||||
# By default, custom builtin functions may only be executed if calc
|
# By default, custom builtin functions may only be executed if calc
|
||||||
# is given the -C option. This is because custom builtin functions
|
# is given the -C option. This is because custom builtin functions
|
||||||
# may invoke non-standard or non-portable code. One may completely
|
# may invoke non-standard or non-portable code. One may completely
|
||||||
# disable custom builtin functions by not compiling any of code
|
# disable custom builtin functions by not compiling any custom code
|
||||||
#
|
#
|
||||||
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
|
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
|
||||||
# ALLOW_CUSTOM= # disable custom even if -C is given
|
# ALLOW_CUSTOM= # disable custom even if -C is given
|
||||||
@@ -794,7 +794,7 @@ ALLOW_CUSTOM= -DCUSTOM
|
|||||||
#ALLOW_CUSTOM=
|
#ALLOW_CUSTOM=
|
||||||
|
|
||||||
# If the $CALCPATH environment variable is not defined, then the following
|
# If the $CALCPATH environment variable is not defined, then the following
|
||||||
# path will be search for calc resource file routines.
|
# path will be searched for calc resource file routines.
|
||||||
#
|
#
|
||||||
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
|
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -809,7 +809,7 @@ endif
|
|||||||
#endif /* end of skip for non-Gnu makefiles */
|
#endif /* end of skip for non-Gnu makefiles */
|
||||||
|
|
||||||
# If the $CALCRC environment variable is not defined, then the following
|
# If the $CALCRC environment variable is not defined, then the following
|
||||||
# path will be search for calc resource files.
|
# path will be searched for calc resource files.
|
||||||
#
|
#
|
||||||
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
|
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -817,7 +817,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
|
|||||||
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
|
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
|
||||||
|
|
||||||
# Determine of the GNU-readline facility will be used instead of the
|
# Determine of the GNU-readline facility will be used instead of the
|
||||||
# built-in calc binding method.
|
# builtin calc binding method.
|
||||||
#
|
#
|
||||||
# USE_READLINE= Do not use GNU-readline, use calc bindings
|
# USE_READLINE= Do not use GNU-readline, use calc bindings
|
||||||
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
|
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
|
||||||
@@ -831,7 +831,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
|
|||||||
# READLINE_INCLUDE Where the readline include files reside
|
# READLINE_INCLUDE Where the readline include files reside
|
||||||
# (leave blank if they are /usr/include/readline)
|
# (leave blank if they are /usr/include/readline)
|
||||||
#
|
#
|
||||||
# NOTE: The GNU-readline code is not shipped with calc. You must have
|
# NOTE: The GNU-readline code is not shipped with calc. You must have
|
||||||
# the appropriate headers and link libs installed on your system in
|
# the appropriate headers and link libs installed on your system in
|
||||||
# order to use it.
|
# order to use it.
|
||||||
#
|
#
|
||||||
@@ -908,9 +908,9 @@ RANLIB=ranlib
|
|||||||
#RANLIB=:
|
#RANLIB=:
|
||||||
|
|
||||||
# Normally certain files depend on the Makefile. If the Makefile is
|
# Normally certain files depend on the Makefile. If the Makefile is
|
||||||
# changed, then certain steps should be redone. If MAKE_FILE is
|
# changed, then certain steps should be redone. If MAKE_FILE is
|
||||||
# set to Makefile, then these files will depend on Makefile. If
|
# set to Makefile, then these files will depend on Makefile. If
|
||||||
# MAKE_FILE is empty, then they wont.
|
# MAKE_FILE is empty, then they won't.
|
||||||
#
|
#
|
||||||
# If in doubt, set MAKE_FILE to Makefile
|
# If in doubt, set MAKE_FILE to Makefile
|
||||||
#
|
#
|
||||||
@@ -971,9 +971,9 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
|
|||||||
#
|
#
|
||||||
# ${MKDIR} ${MKDIR_ARG}
|
# ${MKDIR} ${MKDIR_ARG}
|
||||||
#
|
#
|
||||||
# to create directorties. Normall this amounts to usins mkdir -p dir ...
|
# to create directories. Normally this amounts to using mkdir -p dir ...
|
||||||
# Some older systems may not have mkdir -p. If you system does not
|
# Some older systems may not have mkdir -p. If your system does not
|
||||||
# make mkdir -p, then set MKDIR_ARG to empty.
|
# have mkdir -p, then set MKDIR_ARG to empty.
|
||||||
#
|
#
|
||||||
# MKDIR_ARG= -p # use mkdir -p when creating paths
|
# MKDIR_ARG= -p # use mkdir -p when creating paths
|
||||||
# MKDIR_ARG= # use if system does not understand mkdir -p
|
# MKDIR_ARG= # use if system does not understand mkdir -p
|
||||||
@@ -981,8 +981,8 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
|
|||||||
MKDIR_ARG= -p
|
MKDIR_ARG= -p
|
||||||
#MKDIR_ARG=
|
#MKDIR_ARG=
|
||||||
|
|
||||||
# Some out of date operating systems require / want an executable to
|
# Some out of date operating systems require/want an executable to
|
||||||
# end with a certain file extension. Some compile systems such as
|
# end with a certain file extension. Some compiler systems such as
|
||||||
# windoz build calc as calc.exe. The EXT variable is used to denote
|
# windoz build calc as calc.exe. The EXT variable is used to denote
|
||||||
# the extension required by such. Note that Cygwin requires EXT to be
|
# the extension required by such. Note that Cygwin requires EXT to be
|
||||||
# the same as Linux/Un*x/GNU, even though it runs under windoz.
|
# the same as Linux/Un*x/GNU, even though it runs under windoz.
|
||||||
@@ -997,7 +997,7 @@ EXT=
|
|||||||
|
|
||||||
# The default calc versions
|
# The default calc versions
|
||||||
#
|
#
|
||||||
VERSION= 2.12.4.6
|
VERSION= 2.12.4.11
|
||||||
VERS= 2.12.4
|
VERS= 2.12.4
|
||||||
VER= 2.12
|
VER= 2.12
|
||||||
VE= 2
|
VE= 2
|
||||||
@@ -1048,11 +1048,11 @@ STRIP= strip
|
|||||||
# Extra compiling and linking flags
|
# Extra compiling and linking flags
|
||||||
#
|
#
|
||||||
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files
|
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files
|
||||||
# EXTRA_LDFLAGS are flags given to ${CC} when linking progs
|
# EXTRA_LDFLAGS are flags given to ${CC} when linking programs
|
||||||
#
|
#
|
||||||
# Both CFLAGS and LDFLAGS are left blank in this Makefile by
|
# Both CFLAGS and LDFLAGS are left blank in this Makefile by
|
||||||
# default so that users may use them on the make command line
|
# default so that users may use them on the make command line
|
||||||
# to always the way that C is compiled and files are linked
|
# to always set the way that C is compiled and files are linked
|
||||||
# respectively. For example:
|
# respectively. For example:
|
||||||
#
|
#
|
||||||
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
|
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
|
||||||
@@ -1060,13 +1060,13 @@ STRIP= strip
|
|||||||
# NOTE: These should be left blank in this Makefile to make it
|
# NOTE: These should be left blank in this Makefile to make it
|
||||||
# easier to add stuff on the command line. If you want to
|
# easier to add stuff on the command line. If you want to
|
||||||
# to change the way calc is compiled by this Makefile, change
|
# to change the way calc is compiled by this Makefile, change
|
||||||
# the appropirate host target section below or a flag above.
|
# the appropriate host target section below or a flag above.
|
||||||
#
|
#
|
||||||
EXTRA_CFLAGS=
|
EXTRA_CFLAGS=
|
||||||
EXTRA_LDFLAGS=
|
EXTRA_LDFLAGS=
|
||||||
|
|
||||||
# COMMON_CFLAGS are the common ${CC} flags used for all progs, both
|
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
||||||
# intermediate and final calc and calc related progs
|
# intermediate and final calc and calc related programs
|
||||||
#
|
#
|
||||||
#if 0 /* start of skip for non-Gnu makefiles */
|
#if 0 /* start of skip for non-Gnu makefiles */
|
||||||
ifdef ALLOW_CUSTOM
|
ifdef ALLOW_CUSTOM
|
||||||
@@ -1078,8 +1078,8 @@ COMMON_CFLAGS= -DCALC_SRC -UCUSTOM ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
|
|||||||
endif
|
endif
|
||||||
#endif /* end of skip for non-Gnu makefiles */
|
#endif /* end of skip for non-Gnu makefiles */
|
||||||
|
|
||||||
# COMMON_LDFLAGS are the common flags used for linking all progs, both
|
# COMMON_LDFLAGS are the common flags used for linking all programs, both
|
||||||
# intermediate and final calc and calc related progs
|
# intermediate and final calc and calc related programs
|
||||||
#
|
#
|
||||||
COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
||||||
|
|
||||||
@@ -1097,16 +1097,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# BLD_TYPE= calc-static-only
|
# BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
||||||
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs
|
# DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
|
||||||
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
||||||
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib
|
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
|
||||||
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
||||||
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
||||||
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib
|
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
|
||||||
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
||||||
@@ -1119,8 +1119,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# to abort on warnings, then leave CCWERR blank.
|
# to abort on warnings, then leave CCWERR blank.
|
||||||
# CCMISC are misc flags given to ${CC}
|
# CCMISC are misc flags given to ${CC}
|
||||||
#
|
#
|
||||||
# LCC how the the C compiler is invoked on locally executed intermediate progs
|
# LCC is how the C compiler is invoked on locally executed intermediate programs
|
||||||
# CC is how the the C compiler is invoked (with an optional Purify)
|
# CC is how the C compiler is invoked (with an optional Purify)
|
||||||
#
|
#
|
||||||
# Specific target overrides or modifications to default values
|
# Specific target overrides or modifications to default values
|
||||||
|
|
||||||
@@ -1200,7 +1200,7 @@ CCMISC= ${DARWIN_ARCH}
|
|||||||
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
|
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
#
|
#
|
||||||
# Darmin dynamic shared lib filenames
|
# Darwin dynamic shared lib filenames
|
||||||
LIB_EXT:= .dylib
|
LIB_EXT:= .dylib
|
||||||
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
||||||
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
|
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
|
||||||
@@ -1403,10 +1403,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
|
|||||||
#
|
#
|
||||||
# The simple makefile forces the use of static ${CC} flags
|
# The simple makefile forces the use of static ${CC} flags
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
||||||
CFLAGS= ${ICFLAGS} ${CCOPT}
|
CFLAGS= ${ICFLAGS} ${CCOPT}
|
||||||
@@ -1506,8 +1506,8 @@ endif
|
|||||||
|
|
||||||
# Required flags to compile C files for calc
|
# Required flags to compile C files for calc
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
|
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
|
||||||
#
|
#
|
||||||
@@ -1520,8 +1520,8 @@ CFLAGS= ${ICFLAGS} ${CCOPT}
|
|||||||
|
|
||||||
# Required flags to link files for calc
|
# Required flags to link files for calc
|
||||||
#
|
#
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ILDFLAGS= ${COMMON_LDFLAGS}
|
ILDFLAGS= ${COMMON_LDFLAGS}
|
||||||
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
||||||
@@ -1740,7 +1740,7 @@ CUSTOM_PASSDOWN= \
|
|||||||
VERSION=${VERSION} \
|
VERSION=${VERSION} \
|
||||||
target=${target}
|
target=${target}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to help/Makefile.
|
# The complete list of Makefile vars passed down to help/Makefile.
|
||||||
#
|
#
|
||||||
HELP_PASSDOWN= \
|
HELP_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1777,7 +1777,7 @@ HELP_PASSDOWN= \
|
|||||||
TOUCH=${TOUCH} \
|
TOUCH=${TOUCH} \
|
||||||
TRUE=${TRUE}
|
TRUE=${TRUE}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to cal/Makefile.
|
# The complete list of Makefile vars passed down to cal/Makefile.
|
||||||
#
|
#
|
||||||
CAL_PASSDOWN= \
|
CAL_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1805,7 +1805,7 @@ CAL_PASSDOWN= \
|
|||||||
TOUCH=${TOUCH} \
|
TOUCH=${TOUCH} \
|
||||||
TRUE=${TRUE}
|
TRUE=${TRUE}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to cscript/Makefile.
|
# The complete list of Makefile vars passed down to cscript/Makefile.
|
||||||
#
|
#
|
||||||
CSCRIPT_PASSDOWN= \
|
CSCRIPT_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1854,7 +1854,7 @@ DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README \
|
|||||||
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
|
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
|
||||||
sample.README calc.spec.in rpm.mk
|
sample.README calc.spec.in rpm.mk
|
||||||
|
|
||||||
# These files are used to make (but not built) a calc .a link library
|
# These files are used to make (but not build) a calc .a link library
|
||||||
#
|
#
|
||||||
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
|
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
|
||||||
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
|
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
|
||||||
@@ -1875,7 +1875,7 @@ CALC_STATIC_LIBS= libcalc.a
|
|||||||
endif
|
endif
|
||||||
#endif /* end of skip for non-Gnu makefiles */
|
#endif /* end of skip for non-Gnu makefiles */
|
||||||
|
|
||||||
# Libaraies created and used to build calc
|
# Libraries created and used to build calc
|
||||||
#
|
#
|
||||||
#if 0 /* start of skip for non-Gnu makefiles */
|
#if 0 /* start of skip for non-Gnu makefiles */
|
||||||
ifdef ALLOW_CUSTOM
|
ifdef ALLOW_CUSTOM
|
||||||
@@ -1887,7 +1887,7 @@ CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION}
|
|||||||
endif
|
endif
|
||||||
#endif /* end of skip for non-Gnu makefiles */
|
#endif /* end of skip for non-Gnu makefiles */
|
||||||
|
|
||||||
# Symlinks of dymanic shared libraries
|
# Symlinks of dynamic shared libraries
|
||||||
#
|
#
|
||||||
#if 0 /* start of skip for non-Gnu makefiles */
|
#if 0 /* start of skip for non-Gnu makefiles */
|
||||||
ifdef ALLOW_CUSTOM
|
ifdef ALLOW_CUSTOM
|
||||||
@@ -1903,7 +1903,7 @@ SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
|
|||||||
endif
|
endif
|
||||||
#endif /* end of skip for non-Gnu makefiles */
|
#endif /* end of skip for non-Gnu makefiles */
|
||||||
|
|
||||||
# list of sample programs to that need to be built to satisfy sample rule
|
# list of sample programs that need to be built to satisfy sample rule
|
||||||
#
|
#
|
||||||
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
|
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
|
||||||
# not installed at this time.
|
# not installed at this time.
|
||||||
@@ -1914,7 +1914,7 @@ endif
|
|||||||
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
|
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
|
||||||
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
|
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
|
||||||
|
|
||||||
# list of cscript programs to that need to be built to satisfy cscript/.all
|
# list of cscript programs that need to be built to satisfy cscript/.all
|
||||||
#
|
#
|
||||||
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
|
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
|
||||||
# in the cscript/Makefile
|
# in the cscript/Makefile
|
||||||
@@ -1977,7 +1977,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \
|
echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
|
||||||
echo " previously built .o, libs and executables" 1>&2; \
|
echo " previously built .o, libs and executables" 1>&2; \
|
||||||
echo " before switching to $$r!" 1>&2; \
|
echo " before switching to $$r!" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
@@ -1993,7 +1993,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "to clean out any previously build static files." 1>&2; \
|
echo "to clean out any previously built static files." 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "=== aborting make ===" 1>&2; \
|
echo "=== aborting make ===" 1>&2; \
|
||||||
exit 2; \
|
exit 2; \
|
||||||
@@ -2023,7 +2023,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \
|
echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
|
||||||
echo " previously built .o, libs and executables" 1>&2; \
|
echo " previously built .o, libs and executables" 1>&2; \
|
||||||
echo " before switching to $$r!" 1>&2; \
|
echo " before switching to $$r!" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
@@ -2039,7 +2039,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "to clean out any previously build dynamic files." 1>&2; \
|
echo "to clean out any previously built dynamic files." 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "=== aborting make ===" 1>&2; \
|
echo "=== aborting make ===" 1>&2; \
|
||||||
exit 4; \
|
exit 4; \
|
||||||
@@ -2135,8 +2135,8 @@ seed.o: seed.c no_implicit.arg ${MAKE_FILE}
|
|||||||
###
|
###
|
||||||
#
|
#
|
||||||
# The next set of rules cause the .h files BUILD_H_SRC files to be built
|
# The next set of rules cause the .h files BUILD_H_SRC files to be built
|
||||||
# according tot he system and the Makefile variables above. The hsrc rule
|
# according to the system and the Makefile variables above. The hsrc rule
|
||||||
# is a convenient rule to invoke to built all of the BUILD_H_SRC.
|
# is a convenient rule to invoke to build all of the BUILD_H_SRC.
|
||||||
#
|
#
|
||||||
# We add in the BUILD_C_SRC files because they are similar to the
|
# We add in the BUILD_C_SRC files because they are similar to the
|
||||||
# BUILD_H_SRC files in terms of the build process.
|
# BUILD_H_SRC files in terms of the build process.
|
||||||
@@ -2552,8 +2552,10 @@ have_fpos.h: have_fpos.c ${MAKE_FILE}
|
|||||||
${Q} echo '' >> have_fpos.h
|
${Q} echo '' >> have_fpos.h
|
||||||
${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h
|
${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h
|
||||||
${Q} ${RM} -f have_fpos.o have_fpos${EXT}
|
${Q} ${RM} -f have_fpos.o have_fpos${EXT}
|
||||||
-${Q} ${LCC} ${HAVE_FPOS} ${ICFLAGS} have_fpos.c -c >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${HAVE_FPOS} ${ICFLAGS} have_fpos.c -c \
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_fpos.o -o have_fpos${EXT} >/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
|
-${Q} ${LCC} ${ILDFLAGS} have_fpos.o -o have_fpos${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_fpos${EXT} > fpos_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_fpos${EXT} > fpos_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s fpos_tmp ]; then \
|
-${Q} if [ -s fpos_tmp ]; then \
|
||||||
@@ -2638,8 +2640,9 @@ fposval.h: fposval.c have_fpos.h have_fpos_pos.h have_offscl.h have_posscl.h \
|
|||||||
${Q} echo '/* what are our file position & size types? */' >> fposval.h
|
${Q} echo '/* what are our file position & size types? */' >> fposval.h
|
||||||
${Q} ${RM} -f fposval.o fposval${EXT}
|
${Q} ${RM} -f fposval.o fposval${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${FPOS_BITS} ${OFF_T_BITS} \
|
-${Q} ${LCC} ${ICFLAGS} ${FPOS_BITS} ${OFF_T_BITS} \
|
||||||
${DEV_BITS} ${INODE_BITS} fposval.c -c >/dev/null 2>&1; ${TRUE}
|
${DEV_BITS} ${INODE_BITS} fposval.c -c >/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} fposval.o -o fposval${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} fposval.o -o fposval${EXT} >/dev/null \
|
||||||
|
2>&1; ${TRUE}
|
||||||
${Q} ${SHELL} -c "./fposval${EXT} fposv_tmp >> fposval.h 2>/dev/null" \
|
${Q} ${SHELL} -c "./fposval${EXT} fposv_tmp >> fposval.h 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
${Q} echo '' >> fposval.h
|
${Q} echo '' >> fposval.h
|
||||||
@@ -2673,7 +2676,8 @@ have_const.h: have_const.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_const.o have_const${EXT}
|
${Q} ${RM} -f have_const.o have_const${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_CONST} have_const.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_CONST} have_const.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_const.o -o have_const${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_const.o -o have_const${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_const${EXT} > const_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_const${EXT} > const_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s const_tmp ]; then \
|
-${Q} if [ -s const_tmp ]; then \
|
||||||
@@ -2807,7 +2811,8 @@ align32.h: align32.c longbits.h have_unistd.h ${MAKE_FILE}
|
|||||||
${RM} -f align32.o align32${EXT}; \
|
${RM} -f align32.o align32${EXT}; \
|
||||||
${LCC} ${ICFLAGS} ${ALIGN32} align32.c -c >/dev/null 2>&1; \
|
${LCC} ${ICFLAGS} ${ALIGN32} align32.c -c >/dev/null 2>&1; \
|
||||||
${LCC} ${ILDFLAGS} align32.o -o align32${EXT} >/dev/null 2>&1; \
|
${LCC} ${ILDFLAGS} align32.o -o align32${EXT} >/dev/null 2>&1; \
|
||||||
${SHELL} -c "./align32${EXT} >align32_tmp 2>/dev/null" >/dev/null 2>&1; \
|
${SHELL} -c \
|
||||||
|
"./align32${EXT} >align32_tmp 2>/dev/null" >/dev/null 2>&1; \
|
||||||
if [ -s align32_tmp ]; then \
|
if [ -s align32_tmp ]; then \
|
||||||
${CAT} align32_tmp >> align32.h; \
|
${CAT} align32_tmp >> align32.h; \
|
||||||
else \
|
else \
|
||||||
@@ -2848,7 +2853,8 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_uid_t.o have_uid_t${EXT}
|
${Q} ${RM} -f have_uid_t.o have_uid_t${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_UID_T} have_uid_t.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_UID_T} have_uid_t.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_uid_t.o -o have_uid_t${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_uid_t.o -o have_uid_t${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_uid_t${EXT} > uid_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_uid_t${EXT} > uid_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s uid_tmp ]; then \
|
-${Q} if [ -s uid_tmp ]; then \
|
||||||
@@ -3036,7 +3042,8 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f getpgid_tmp have_getpgid.h
|
${Q} ${RM} -f getpgid_tmp have_getpgid.h
|
||||||
${Q} echo 'forming have_getpgid.h'
|
${Q} echo 'forming have_getpgid.h'
|
||||||
${Q} echo '/*' > have_getpgid.h
|
${Q} echo '/*' > have_getpgid.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_getpgid.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_getpgid.h
|
||||||
${Q} echo ' */' >> have_getpgid.h
|
${Q} echo ' */' >> have_getpgid.h
|
||||||
${Q} echo '' >> have_getpgid.h
|
${Q} echo '' >> have_getpgid.h
|
||||||
${Q} echo '' >> have_getpgid.h
|
${Q} echo '' >> have_getpgid.h
|
||||||
@@ -3076,7 +3083,8 @@ have_gettime.h: have_gettime.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f gettime_tmp have_gettime.h
|
${Q} ${RM} -f gettime_tmp have_gettime.h
|
||||||
${Q} echo 'forming have_gettime.h'
|
${Q} echo 'forming have_gettime.h'
|
||||||
${Q} echo '/*' > have_gettime.h
|
${Q} echo '/*' > have_gettime.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_gettime.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_gettime.h
|
||||||
${Q} echo ' */' >> have_gettime.h
|
${Q} echo ' */' >> have_gettime.h
|
||||||
${Q} echo '' >> have_gettime.h
|
${Q} echo '' >> have_gettime.h
|
||||||
${Q} echo '' >> have_gettime.h
|
${Q} echo '' >> have_gettime.h
|
||||||
@@ -3116,7 +3124,8 @@ have_getprid.h: have_getprid.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f getprid_tmp have_getprid.h
|
${Q} ${RM} -f getprid_tmp have_getprid.h
|
||||||
${Q} echo 'forming have_getprid.h'
|
${Q} echo 'forming have_getprid.h'
|
||||||
${Q} echo '/*' > have_getprid.h
|
${Q} echo '/*' > have_getprid.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_getprid.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_getprid.h
|
||||||
${Q} echo ' */' >> have_getprid.h
|
${Q} echo ' */' >> have_getprid.h
|
||||||
${Q} echo '' >> have_getprid.h
|
${Q} echo '' >> have_getprid.h
|
||||||
${Q} echo '' >> have_getprid.h
|
${Q} echo '' >> have_getprid.h
|
||||||
@@ -3156,7 +3165,8 @@ have_urandom.h: ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_urandom.h
|
${Q} ${RM} -f have_urandom.h
|
||||||
${Q} echo 'forming have_urandom.h'
|
${Q} echo 'forming have_urandom.h'
|
||||||
${Q} echo '/*' > have_urandom.h
|
${Q} echo '/*' > have_urandom.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_urandom.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_urandom.h
|
||||||
${Q} echo ' */' >> have_urandom.h
|
${Q} echo ' */' >> have_urandom.h
|
||||||
${Q} echo '' >> have_urandom.h
|
${Q} echo '' >> have_urandom.h
|
||||||
${Q} echo '' >> have_urandom.h
|
${Q} echo '' >> have_urandom.h
|
||||||
@@ -3192,7 +3202,8 @@ have_rusage.h: have_rusage.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f rusage_tmp have_rusage.h
|
${Q} ${RM} -f rusage_tmp have_rusage.h
|
||||||
${Q} echo 'forming have_rusage.h'
|
${Q} echo 'forming have_rusage.h'
|
||||||
${Q} echo '/*' > have_rusage.h
|
${Q} echo '/*' > have_rusage.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_rusage.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_rusage.h
|
||||||
${Q} echo ' */' >> have_rusage.h
|
${Q} echo ' */' >> have_rusage.h
|
||||||
${Q} echo '' >> have_rusage.h
|
${Q} echo '' >> have_rusage.h
|
||||||
${Q} echo '' >> have_rusage.h
|
${Q} echo '' >> have_rusage.h
|
||||||
@@ -3283,14 +3294,16 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h have_string.h
|
|||||||
${Q} ${RM} -f have_stdvs.o have_stdvs${EXT}
|
${Q} ${RM} -f have_stdvs.o have_stdvs${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_stdvs.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_stdvs.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_stdvs.o -o have_stdvs${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_stdvs.o -o have_stdvs${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if ./have_stdvs${EXT} >>args.h 2>/dev/null; then \
|
-${Q} if ./have_stdvs${EXT} >>args.h 2>/dev/null; then \
|
||||||
${TOUCH} have_args.sh; \
|
${TOUCH} have_args.sh; \
|
||||||
else \
|
else \
|
||||||
${TRUE}; \
|
${TRUE}; \
|
||||||
fi
|
fi
|
||||||
-${Q} if [ ! -f have_args.sh ] && [ X"${HAVE_VSPRINTF}" = X ]; then \
|
-${Q} if [ ! -f have_args.sh ] && [ X"${HAVE_VSPRINTF}" = X ]; then \
|
||||||
${RM} -f have_stdvs.o have_stdvs${EXT} have_varvs.o have_varvs${EXT}; \
|
${RM} -f have_stdvs.o have_stdvs${EXT} have_varvs.o; \
|
||||||
|
${RM} -f have_varvs${EXT}; \
|
||||||
${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_varvs.c -c \
|
${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_varvs.c -c \
|
||||||
2>/dev/null; \
|
2>/dev/null; \
|
||||||
${LCC} ${ILDFLAGS} have_varvs.o -o have_varvs${EXT} 2>/dev/null; \
|
${LCC} ${ILDFLAGS} have_varvs.o -o have_varvs${EXT} 2>/dev/null; \
|
||||||
@@ -3314,7 +3327,8 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h have_string.h
|
|||||||
${Q} echo '' >> args.h
|
${Q} echo '' >> args.h
|
||||||
${Q} echo '' >> args.h
|
${Q} echo '' >> args.h
|
||||||
${Q} echo '#endif /* !__ARGS_H__ */' >> args.h
|
${Q} echo '#endif /* !__ARGS_H__ */' >> args.h
|
||||||
${Q} ${RM} -f have_stdvs.o have_varvs.o have_varvs${EXT} have_args.sh core
|
${Q} ${RM} -f have_stdvs.o have_varvs.o have_varvs${EXT} have_args.sh
|
||||||
|
${Q} ${RM} -f core
|
||||||
${Q} echo 'args.h formed'
|
${Q} echo 'args.h formed'
|
||||||
-@if [ -z "${Q}" ]; then \
|
-@if [ -z "${Q}" ]; then \
|
||||||
echo ''; \
|
echo ''; \
|
||||||
@@ -3388,7 +3402,8 @@ no_implicit.arg: no_implicit.c ${MAKE_FILE}
|
|||||||
else \
|
else \
|
||||||
${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \
|
${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \
|
||||||
no_implicit.c -c >/dev/null 2>&1; \
|
no_implicit.c -c >/dev/null 2>&1; \
|
||||||
${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} >/dev/null 2>&1; \
|
${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} \
|
||||||
|
>/dev/null 2>&1; \
|
||||||
${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \
|
${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}; \
|
>/dev/null 2>&1; ${TRUE}; \
|
||||||
fi
|
fi
|
||||||
@@ -3577,7 +3592,7 @@ endif
|
|||||||
|
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# building calc-static and static lib*.a libraires
|
# building calc-static and static lib*.a libraries
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
|
|
||||||
@@ -3616,10 +3631,10 @@ sample_many-static${EXT}: sample_many.o ${CALC_STATIC_LIBS} ${MAKE_FILE}
|
|||||||
|
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# Home grown make dependency rules. Your system make not support
|
# Homegrown make dependency rules. Your system may not support
|
||||||
# or have the needed tools. You can ignore this section.
|
# or have the needed tools. You can ignore this section.
|
||||||
#
|
#
|
||||||
# We will form a skelaton tree of *.c files containing only #include "foo.h"
|
# We will form a skeleton tree of *.c files containing only #include "foo.h"
|
||||||
# lines and .h files containing the same lines surrounded by multiple include
|
# lines and .h files containing the same lines surrounded by multiple include
|
||||||
# prevention lines. This allows us to build a static depend list that will
|
# prevention lines. This allows us to build a static depend list that will
|
||||||
# satisfy all possible cpp symbol definition combinations.
|
# satisfy all possible cpp symbol definition combinations.
|
||||||
@@ -3673,7 +3688,8 @@ depend: custom/Makefile hsrc
|
|||||||
${Q} echo forming new ${MAKE_FILE}
|
${Q} echo forming new ${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE}
|
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -rf skel
|
${Q} ${RM} -rf skel
|
||||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||||
@@ -3728,21 +3744,21 @@ h_list:
|
|||||||
# 1 level version string.
|
# 1 level version string.
|
||||||
#
|
#
|
||||||
# version:
|
# version:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces the full version string. Note that the
|
# This rule produces the full version string. Note that the
|
||||||
# full version could be 4 or 3 levels long depending on the
|
# full version could be 4 or 3 levels long depending on the
|
||||||
# minor patch number.
|
# minor patch number.
|
||||||
#
|
#
|
||||||
# vers:
|
# vers:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 3 level version string.
|
# This rule produces only a 3 level version string.
|
||||||
#
|
#
|
||||||
# ver:
|
# ver:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 2 level version string.
|
# This rule produces only a 2 level version string.
|
||||||
#
|
#
|
||||||
# ve:
|
# ve:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 1 level version string.
|
# This rule produces only a 1 level version string.
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
@@ -3860,7 +3876,7 @@ custom/Makefile.simple: custom/Makefile
|
|||||||
#
|
#
|
||||||
# Doing a 'make chk' will cause only the context around interesting
|
# Doing a 'make chk' will cause only the context around interesting
|
||||||
# (and error) messages to be printed. Unlike 'make check', this
|
# (and error) messages to be printed. Unlike 'make check', this
|
||||||
# rule does not cause things to be built. I.e., the all rule is
|
# rule does not cause things to be built. i.e., the all rule is
|
||||||
# not invoked.
|
# not invoked.
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
@@ -4056,34 +4072,38 @@ env:
|
|||||||
|
|
||||||
mkdebug: env version.c
|
mkdebug: env version.c
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the source version =-=-=-=-='
|
@echo '=-=-=-= Determining the source version =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
||||||
-@./ver_calc${EXT}
|
-@./ver_calc${EXT}
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ all
|
@${MAKE} -f Makefile Q= V=@ all
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the binary version =-=-=-=-='
|
@echo '=-=-=-= Determining the binary version =-=-=-='
|
||||||
-@./calc${EXT} -e -q -v
|
-@./calc${EXT} -e -q -v
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
debug: env
|
debug: env
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ clobber
|
@${MAKE} -f Makefile Q= V=@ clobber
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the source version =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
|
||||||
|
@echo '=-=-= this may take a bit of time =-=-='
|
||||||
|
@${MAKE} -f Makefile Q= V=@ all
|
||||||
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
|
@echo '=-=-=-= Determining the source version =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
||||||
-@./ver_calc${EXT}
|
-@./ver_calc${EXT}
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ all
|
@echo -n '=-=-=-= Print #defile values if custom functions '
|
||||||
@echo '=-=-=-=-= Determining the binary version =-=-=-=-='
|
@echo 'are allowed =-=-=-='
|
||||||
-@./calc${EXT} -e -q -v
|
-@./calc${EXT} -e -q -C 'print custom("sysinfo", 2);'
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ chk =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ check =-=-=-='
|
||||||
@echo '=-=-=-=-= this may take a while =-=-=-=-='
|
@echo '=-=-= this may take a while =-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ chk
|
@${MAKE} -f Makefile Q= V=@ check
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -4148,7 +4168,8 @@ rpm-unhide-static:
|
|||||||
|
|
||||||
rpm-chk-static:
|
rpm-chk-static:
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
${CALC_ENV} ./calc-static${EXT} -d -q read regress 2>&1 | ${AWK} -f check.awk
|
${CALC_ENV} ./calc-static${EXT} -d -q read regress 2>&1 | \
|
||||||
|
${AWK} -f check.awk
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
rpm-clean-static:
|
rpm-clean-static:
|
||||||
@@ -4193,7 +4214,7 @@ inst_files: ${MAKE_FILE} help/Makefile cal/Makefile custom/Makefile \
|
|||||||
${Q} LANG=C ${SORT} -u inst_files -o inst_files
|
${Q} LANG=C ${SORT} -u inst_files -o inst_files
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
# The olduninstall rule will remove calc files from the older, histroic
|
# The olduninstall rule will remove calc files from the older, historic
|
||||||
# locations under the /usr/local directory. If you are using the
|
# locations under the /usr/local directory. If you are using the
|
||||||
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
|
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
|
||||||
# then you can use this rule to clean out the older calc stuff under
|
# then you can use this rule to clean out the older calc stuff under
|
||||||
@@ -4312,7 +4333,7 @@ clobber: custom/Makefile clean
|
|||||||
|
|
||||||
# install everything
|
# install everything
|
||||||
#
|
#
|
||||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
# NOTE: Keep the uninstall rule in the reverse order of the install rule
|
||||||
#
|
#
|
||||||
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@@ -4547,7 +4568,8 @@ endif
|
|||||||
continue; \
|
continue; \
|
||||||
fi; \
|
fi; \
|
||||||
${RM} -f tmp; \
|
${RM} -f tmp; \
|
||||||
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' $$i > tmp; \
|
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' \
|
||||||
|
$$i > tmp; \
|
||||||
if ${CMP} -s tmp ${T}${CALC_INCDIR}/$$i; then \
|
if ${CMP} -s tmp ${T}${CALC_INCDIR}/$$i; then \
|
||||||
${TRUE}; \
|
${TRUE}; \
|
||||||
else \
|
else \
|
||||||
@@ -4618,7 +4640,7 @@ endif
|
|||||||
|
|
||||||
# Try to remove everything that was installed
|
# Try to remove everything that was installed
|
||||||
#
|
#
|
||||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
# NOTE: Keep the uninstall rule in the reverse order of the install rule
|
||||||
#
|
#
|
||||||
uninstall: custom/Makefile
|
uninstall: custom/Makefile
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@@ -4670,7 +4692,7 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}";\
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4678,7 +4700,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
echo -n "cannot uninstall "; \
|
||||||
|
echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4686,7 +4709,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
echo \
|
||||||
|
"cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4694,9 +4718,10 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
echo \
|
||||||
|
"cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}";\
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}";\
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT}" ]; then \
|
||||||
@@ -4734,7 +4759,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
${RM} -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
echo -n "cannot uninstall " \
|
||||||
|
echo "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4818,7 +4844,7 @@ strip:
|
|||||||
done
|
done
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
# calc-symlink - setup symlinks from stardard locations into the ${T} tree
|
# calc-symlink - setup symlinks from standard locations into the ${T} tree
|
||||||
#
|
#
|
||||||
calc-symlink:
|
calc-symlink:
|
||||||
${Q}if [ -z "${T}" ]; then \
|
${Q}if [ -z "${T}" ]; then \
|
||||||
@@ -4852,15 +4878,20 @@ calc-symlink:
|
|||||||
done
|
done
|
||||||
-${Q} if [ -n "${CATDIR}" ]; then \
|
-${Q} if [ -n "${CATDIR}" ]; then \
|
||||||
if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
if [ ! -L "${CATDIR}/calc.${CATEXT}" -a "${T}${CATDIR}/calc.${CATEXT}" -ef "${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ ! -L "${CATDIR}/calc.${CATEXT}" -a \
|
||||||
echo "ERROR: ${T}${CATDIR}/calc.${CATEXT} is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
"${T}${CATDIR}/calc.${CATEXT}" -ef \
|
||||||
|
"${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
|
echo -n "ERROR: ${T}${CATDIR}/calc.${CATEXT}" 2>&1; \
|
||||||
|
echo "is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
||||||
else \
|
else \
|
||||||
if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
fi; \
|
fi; \
|
||||||
echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \
|
echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" \
|
||||||
${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \
|
"${CATDIR}/calc.${CATEXT}"; \
|
||||||
|
${LN} -s "${T}${CATDIR}/calc.${CATEXT}" \
|
||||||
|
"${CATDIR}/calc.${CATEXT}"; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
@@ -4889,7 +4920,8 @@ calc-unsymlink:
|
|||||||
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
else \
|
else \
|
||||||
echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" \
|
||||||
|
1>&2; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
318
Makefile.simple
318
Makefile.simple
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
# Gnu makefile: # This is a Gnu make makefile. If your make does not #
|
# Gnu makefile: # This is a Gnu make makefile. If your make does not #
|
||||||
# Gnu makefile: # understand this makefilkke format, then edit and use #
|
# Gnu makefile: # understand this makefile format, then edit and use #
|
||||||
# Gnu makefile: # Makefile.simple instead of this Makefile. #
|
# Gnu makefile: # Makefile.simple instead of this Makefile. #
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
#
|
#
|
||||||
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
|
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
|
||||||
# Makefile for the people who build calc from the bzip2-ed tarball.
|
# Makefile for the people who build calc from the bzip2-ed tarball.
|
||||||
# Without modification, it not assume the system has readline, ncurses
|
# Without modification, it does not assume the system has readline,
|
||||||
# or less. It compiles with gcc -O3 -g3 as well. You can change all
|
# ncurses or less. It compiles with gcc -O3 -g3 as well. You can
|
||||||
# this by modifying the Makefile variables below.
|
# change all this by modifying the Makefile variables below.
|
||||||
#
|
#
|
||||||
# NOTE: You might want use the READLINE facility if your system
|
# NOTE: You might want use the READLINE facility if your system
|
||||||
# has the GNU readline headers and libaraies:
|
# has the GNU readline headers and libraries:
|
||||||
#
|
#
|
||||||
# USE_READLINE= -DUSE_READLINE
|
# USE_READLINE= -DUSE_READLINE
|
||||||
# READLINE_LIB= -lreadline
|
# READLINE_LIB= -lreadline
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# Copyright (C) 1999-2008 Landon Curt Noll
|
# Copyright (C) 1999-2008 Landon Curt Noll
|
||||||
#
|
#
|
||||||
# Calc is open software; you can redistribute it and/or modify it under
|
# Calc is open software; you can redistribute it and/or modify it under
|
||||||
# the terms of the version 2.1 of the GNU Lesser General Public License
|
# the terms of version 2.1 of the GNU Lesser General Public License
|
||||||
# as published by the Free Software Foundation.
|
# as published by the Free Software Foundation.
|
||||||
#
|
#
|
||||||
# Calc is distributed in the hope that it will be useful, but WITHOUT
|
# Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
MAKEFILE_REV= $$Revision: 30.49 $$
|
MAKEFILE_REV= $$Revision: 30.58 $$
|
||||||
# @(#) $Id: Makefile.ship,v 30.49 2013/03/25 21:31:55 chongo Exp chongo $
|
# @(#) $Id: Makefile.ship,v 30.58 2013/08/18 20:36:50 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
|
# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1990/02/15 01:48:41
|
# Under source code control: 1990/02/15 01:48:41
|
||||||
@@ -86,13 +86,13 @@ TERMCONTROL=
|
|||||||
# If you do not have vsprintf(), then calc will try sprintf() and hope
|
# If you do not have vsprintf(), then calc will try sprintf() and hope
|
||||||
# for the best.
|
# for the best.
|
||||||
#
|
#
|
||||||
# A simular problem occurs if your system does not have a vsnprintf()
|
# A similar problem occurs if your system does not have a vsnprintf()
|
||||||
# function. This function is like the vsprintf() function except that
|
# function. This function is like the vsprintf() function except that
|
||||||
# there is an extra second argument that controls the maximum size
|
# there is an extra second argument that controls the maximum size
|
||||||
# string that is produced.
|
# string that is produced.
|
||||||
#
|
#
|
||||||
# If HAVE_VSPRINTF is empty, this Makefile will run the have_stdvs.c and/or
|
# If HAVE_VSPRINTF is empty, this Makefile will run the have_stdvs.c and/or
|
||||||
# have_varvs.c program to determine if vsprintf() is supported. If
|
# have_varvs.c program to determine if vsprintf() is supported. If
|
||||||
# HAVE_VSPRINTF is set to -DDONT_HAVE_VSPRINTF then calc will hope that
|
# HAVE_VSPRINTF is set to -DDONT_HAVE_VSPRINTF then calc will hope that
|
||||||
# sprintf() will work.
|
# sprintf() will work.
|
||||||
#
|
#
|
||||||
@@ -228,13 +228,13 @@ INODE_BITS=
|
|||||||
#INODE_BITS= 64
|
#INODE_BITS= 64
|
||||||
|
|
||||||
# Determine if we have an off_t which one can perform arithmetic operations,
|
# Determine if we have an off_t which one can perform arithmetic operations,
|
||||||
# assignments and comparisons. On some systems off_t is some sort of union
|
# assignments and comparisons. On some systems off_t is some sort of union
|
||||||
# or struct.
|
# or struct.
|
||||||
#
|
#
|
||||||
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
|
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
|
||||||
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
|
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
|
||||||
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
|
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
|
||||||
# union or struct which.
|
# union or struct.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -242,7 +242,7 @@ HAVE_OFFSCL=
|
|||||||
#HAVE_OFFSCL= -DOFF_T_NON_SCALAR
|
#HAVE_OFFSCL= -DOFF_T_NON_SCALAR
|
||||||
|
|
||||||
# Determine if we have an fpos_t which one can perform arithmetic operations,
|
# Determine if we have an fpos_t which one can perform arithmetic operations,
|
||||||
# assignments and comparisons. On some systems fpos_t is some sort of union
|
# assignments and comparisons. On some systems fpos_t is some sort of union
|
||||||
# or struct. Some systems do not have an fpos_t and long is as a file
|
# or struct. Some systems do not have an fpos_t and long is as a file
|
||||||
# offset instead.
|
# offset instead.
|
||||||
#
|
#
|
||||||
@@ -250,7 +250,7 @@ HAVE_OFFSCL=
|
|||||||
# to determine if off_t is a scalar, or if there is no off_t and long
|
# to determine if off_t is a scalar, or if there is no off_t and long
|
||||||
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value
|
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value
|
||||||
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
|
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
|
||||||
# some sort of union or struct which.
|
# some sort of union or struct.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -271,7 +271,7 @@ HAVE_CONST=
|
|||||||
# Determine if we have uid_t
|
# Determine if we have uid_t
|
||||||
#
|
#
|
||||||
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
|
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
|
||||||
# to determine if const is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
|
# to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
|
||||||
# then calc will treat uid_t as an unsigned short. This only matters if
|
# then calc will treat uid_t as an unsigned short. This only matters if
|
||||||
# $HOME is not set and calc must look up the home directory in /etc/passwd.
|
# $HOME is not set and calc must look up the home directory in /etc/passwd.
|
||||||
#
|
#
|
||||||
@@ -298,7 +298,7 @@ HAVE_NEWSTR=
|
|||||||
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
|
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
|
||||||
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to
|
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to
|
||||||
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
|
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the memory move function that does correct overlapping memory moves.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -307,10 +307,10 @@ HAVE_MEMMOVE=
|
|||||||
|
|
||||||
# Determine if we have ustat()
|
# Determine if we have ustat()
|
||||||
#
|
#
|
||||||
# If HAVE_USTAT is empty, this Makefile will run the have_memmv program
|
# If HAVE_USTAT is empty, this Makefile will run the have_ustat program
|
||||||
# to determine if ustat() is supported. If HAVE_USTAT is set to
|
# to determine if ustat() is supported. If HAVE_USTAT is set to
|
||||||
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate
|
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the ustat() function that gets file system statistics.
|
||||||
#
|
#
|
||||||
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
|
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -321,10 +321,10 @@ HAVE_USTAT=
|
|||||||
|
|
||||||
# Determine if we have getsid()
|
# Determine if we have getsid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETSID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETSID is empty, this Makefile will run the have_getsid program
|
||||||
# to determine if getsid() is supported. If HAVE_GETSID is set to
|
# to determine if getsid() is supported. If HAVE_GETSID is set to
|
||||||
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getsid() function that gets session ID.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
|
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -335,10 +335,10 @@ HAVE_GETSID=
|
|||||||
|
|
||||||
# Determine if we have getpgid()
|
# Determine if we have getpgid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETPGID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program
|
||||||
# to determine if getpgid() is supported. If HAVE_GETPGID is set to
|
# to determine if getpgid() is supported. If HAVE_GETPGID is set to
|
||||||
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getpgid() function that sets the process group ID.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
|
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -349,10 +349,10 @@ HAVE_GETPGID=
|
|||||||
|
|
||||||
# Determine if we have clock_gettime()
|
# Determine if we have clock_gettime()
|
||||||
#
|
#
|
||||||
# If HAVE_GETTIME is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETTIME is empty, this Makefile will run the have_gettime program
|
||||||
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
|
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
|
||||||
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the clock_gettime() function.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
|
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -363,10 +363,10 @@ HAVE_GETTIME=
|
|||||||
|
|
||||||
# Determine if we have getprid()
|
# Determine if we have getprid()
|
||||||
#
|
#
|
||||||
# If HAVE_GETPRID is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETPRID is empty, this Makefile will run the have_getprid program
|
||||||
# to determine if getprid() is supported. If HAVE_GETPRID is set to
|
# to determine if getprid() is supported. If HAVE_GETPRID is set to
|
||||||
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getprid() function.
|
||||||
#
|
#
|
||||||
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
|
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -377,7 +377,7 @@ HAVE_GETPRID=
|
|||||||
|
|
||||||
# Determine if we have the /dev/urandom
|
# Determine if we have the /dev/urandom
|
||||||
#
|
#
|
||||||
# HAVE_URANDOM_H= let the Makefile look /dev/urandom
|
# HAVE_URANDOM_H= let the Makefile look for /dev/urandom
|
||||||
# HAVE_URANDOM_H= YES assume that /dev/urandom exists
|
# HAVE_URANDOM_H= YES assume that /dev/urandom exists
|
||||||
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
|
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
|
||||||
#
|
#
|
||||||
@@ -391,10 +391,10 @@ HAVE_URANDOM_H=
|
|||||||
|
|
||||||
# Determine if we have getrusage()
|
# Determine if we have getrusage()
|
||||||
#
|
#
|
||||||
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_memmv program
|
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program
|
||||||
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
|
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
|
||||||
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
|
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the getrusage() function.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -403,10 +403,10 @@ HAVE_GETRUSAGE=
|
|||||||
|
|
||||||
# Determine if we have strdup()
|
# Determine if we have strdup()
|
||||||
#
|
#
|
||||||
# If HAVE_STRDUP is empty, this Makefile will run the have_memmv program
|
# If HAVE_STRDUP is empty, this Makefile will run the have_strdup program
|
||||||
# to determine if strdup() is supported. If HAVE_STRDUP is set to
|
# to determine if strdup() is supported. If HAVE_STRDUP is set to
|
||||||
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
|
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
|
||||||
# the memory move function that does correct overlapping memory modes.
|
# the strdup() function.
|
||||||
#
|
#
|
||||||
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
|
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
|
||||||
#
|
#
|
||||||
@@ -414,10 +414,10 @@ HAVE_STRDUP=
|
|||||||
#HAVE_STRDUP= -DHAVE_NO_STRDUP
|
#HAVE_STRDUP= -DHAVE_NO_STRDUP
|
||||||
|
|
||||||
# Some architectures such as Sparc do not allow one to access 32 bit values
|
# Some architectures such as Sparc do not allow one to access 32 bit values
|
||||||
# that are not alligned on a 32 bit boundary.
|
# that are not aligned on a 32 bit boundary.
|
||||||
#
|
#
|
||||||
# The Dec Alpha running OSF/1 will produce alignment error messages when
|
# The Dec Alpha running OSF/1 will produce alignment error messages when
|
||||||
# align32.c tries to figure out if alignment is needed. Use the
|
# align32.c tries to figure out if alignment is needed. Use the
|
||||||
# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages.
|
# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages.
|
||||||
#
|
#
|
||||||
# ALIGN32= let align32.c figure out if alignment is needed
|
# ALIGN32= let align32.c figure out if alignment is needed
|
||||||
@@ -572,7 +572,7 @@ HAVE_UNUSED=
|
|||||||
#INCDIR= /dev/env/DJDIR/include
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
INCDIR= /usr/include
|
INCDIR= /usr/include
|
||||||
|
|
||||||
# Where to install calc realted things
|
# Where to install calc related things
|
||||||
#
|
#
|
||||||
# ${BINDIR} where to install calc binary files
|
# ${BINDIR} where to install calc binary files
|
||||||
# ${LIBDIR} where calc link library (*.a) files are installed
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
@@ -657,7 +657,7 @@ SCRIPTDIR= ${BINDIR}/cscript
|
|||||||
# T - top level directory under which calc will be installed
|
# T - top level directory under which calc will be installed
|
||||||
#
|
#
|
||||||
# The calc install is performed under ${T}, the calc build is
|
# The calc install is performed under ${T}, the calc build is
|
||||||
# performed under /. The purpose for ${T} is to allow someone
|
# performed under /. The purpose for ${T} is to allow someone
|
||||||
# to install calc somewhere other than into the system area.
|
# to install calc somewhere other than into the system area.
|
||||||
#
|
#
|
||||||
# For example, if:
|
# For example, if:
|
||||||
@@ -675,7 +675,7 @@ SCRIPTDIR= ${BINDIR}/cscript
|
|||||||
# calc binary files: /var/tmp/testing/usr/bin
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
# calc link library: /var/tmp/testing/usr/lib
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
# ... etc ... /var/tmp/testing/...
|
# ... etc ... /var/tmp/testing/...
|
||||||
#
|
#
|
||||||
# If ${T} is empty, calc is installed under /, which is the same
|
# If ${T} is empty, calc is installed under /, which is the same
|
||||||
# top of tree for which it was built. If ${T} is non-empty, then
|
# top of tree for which it was built. If ${T} is non-empty, then
|
||||||
@@ -739,12 +739,12 @@ CATEXT= 1
|
|||||||
# If NROFF is non-empty, then
|
# If NROFF is non-empty, then
|
||||||
#
|
#
|
||||||
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
|
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
|
||||||
# is used to built and install the cat page
|
# is used to build and install the cat page
|
||||||
#
|
#
|
||||||
# else (NROFF is empty)
|
# else (NROFF is empty)
|
||||||
#
|
#
|
||||||
# ${MANMAKE} calc.1 ${CATDIR}
|
# ${MANMAKE} calc.1 ${CATDIR}
|
||||||
# is used to built and install the cat page
|
# is used to build and install the cat page
|
||||||
# else
|
# else
|
||||||
#
|
#
|
||||||
# The cat page is not built or installed
|
# The cat page is not built or installed
|
||||||
@@ -767,8 +767,8 @@ CATMODE= 0444
|
|||||||
|
|
||||||
# By default, custom builtin functions may only be executed if calc
|
# By default, custom builtin functions may only be executed if calc
|
||||||
# is given the -C option. This is because custom builtin functions
|
# is given the -C option. This is because custom builtin functions
|
||||||
# may invoke non-standard or non-portable code. One may completely
|
# may invoke non-standard or non-portable code. One may completely
|
||||||
# disable custom builtin functions by not compiling any of code
|
# disable custom builtin functions by not compiling any custom code
|
||||||
#
|
#
|
||||||
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
|
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
|
||||||
# ALLOW_CUSTOM= # disable custom even if -C is given
|
# ALLOW_CUSTOM= # disable custom even if -C is given
|
||||||
@@ -779,14 +779,14 @@ ALLOW_CUSTOM= -DCUSTOM
|
|||||||
#ALLOW_CUSTOM=
|
#ALLOW_CUSTOM=
|
||||||
|
|
||||||
# If the $CALCPATH environment variable is not defined, then the following
|
# If the $CALCPATH environment variable is not defined, then the following
|
||||||
# path will be search for calc resource file routines.
|
# path will be searched for calc resource file routines.
|
||||||
#
|
#
|
||||||
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
|
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
|
||||||
#
|
#
|
||||||
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR}
|
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR}
|
||||||
|
|
||||||
# If the $CALCRC environment variable is not defined, then the following
|
# If the $CALCRC environment variable is not defined, then the following
|
||||||
# path will be search for calc resource files.
|
# path will be searched for calc resource files.
|
||||||
#
|
#
|
||||||
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
|
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
|
||||||
#
|
#
|
||||||
@@ -794,7 +794,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
|
|||||||
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
|
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
|
||||||
|
|
||||||
# Determine of the GNU-readline facility will be used instead of the
|
# Determine of the GNU-readline facility will be used instead of the
|
||||||
# built-in calc binding method.
|
# builtin calc binding method.
|
||||||
#
|
#
|
||||||
# USE_READLINE= Do not use GNU-readline, use calc bindings
|
# USE_READLINE= Do not use GNU-readline, use calc bindings
|
||||||
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
|
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
|
||||||
@@ -808,7 +808,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
|
|||||||
# READLINE_INCLUDE Where the readline include files reside
|
# READLINE_INCLUDE Where the readline include files reside
|
||||||
# (leave blank if they are /usr/include/readline)
|
# (leave blank if they are /usr/include/readline)
|
||||||
#
|
#
|
||||||
# NOTE: The GNU-readline code is not shipped with calc. You must have
|
# NOTE: The GNU-readline code is not shipped with calc. You must have
|
||||||
# the appropriate headers and link libs installed on your system in
|
# the appropriate headers and link libs installed on your system in
|
||||||
# order to use it.
|
# order to use it.
|
||||||
#
|
#
|
||||||
@@ -885,9 +885,9 @@ RANLIB=ranlib
|
|||||||
#RANLIB=:
|
#RANLIB=:
|
||||||
|
|
||||||
# Normally certain files depend on the Makefile. If the Makefile is
|
# Normally certain files depend on the Makefile. If the Makefile is
|
||||||
# changed, then certain steps should be redone. If MAKE_FILE is
|
# changed, then certain steps should be redone. If MAKE_FILE is
|
||||||
# set to Makefile, then these files will depend on Makefile. If
|
# set to Makefile, then these files will depend on Makefile. If
|
||||||
# MAKE_FILE is empty, then they wont.
|
# MAKE_FILE is empty, then they won't.
|
||||||
#
|
#
|
||||||
# If in doubt, set MAKE_FILE to Makefile
|
# If in doubt, set MAKE_FILE to Makefile
|
||||||
#
|
#
|
||||||
@@ -948,9 +948,9 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
|
|||||||
#
|
#
|
||||||
# ${MKDIR} ${MKDIR_ARG}
|
# ${MKDIR} ${MKDIR_ARG}
|
||||||
#
|
#
|
||||||
# to create directorties. Normall this amounts to usins mkdir -p dir ...
|
# to create directories. Normally this amounts to using mkdir -p dir ...
|
||||||
# Some older systems may not have mkdir -p. If you system does not
|
# Some older systems may not have mkdir -p. If your system does not
|
||||||
# make mkdir -p, then set MKDIR_ARG to empty.
|
# have mkdir -p, then set MKDIR_ARG to empty.
|
||||||
#
|
#
|
||||||
# MKDIR_ARG= -p # use mkdir -p when creating paths
|
# MKDIR_ARG= -p # use mkdir -p when creating paths
|
||||||
# MKDIR_ARG= # use if system does not understand mkdir -p
|
# MKDIR_ARG= # use if system does not understand mkdir -p
|
||||||
@@ -958,8 +958,8 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
|
|||||||
MKDIR_ARG= -p
|
MKDIR_ARG= -p
|
||||||
#MKDIR_ARG=
|
#MKDIR_ARG=
|
||||||
|
|
||||||
# Some out of date operating systems require / want an executable to
|
# Some out of date operating systems require/want an executable to
|
||||||
# end with a certain file extension. Some compile systems such as
|
# end with a certain file extension. Some compiler systems such as
|
||||||
# windoz build calc as calc.exe. The EXT variable is used to denote
|
# windoz build calc as calc.exe. The EXT variable is used to denote
|
||||||
# the extension required by such. Note that Cygwin requires EXT to be
|
# the extension required by such. Note that Cygwin requires EXT to be
|
||||||
# the same as Linux/Un*x/GNU, even though it runs under windoz.
|
# the same as Linux/Un*x/GNU, even though it runs under windoz.
|
||||||
@@ -974,7 +974,7 @@ EXT=
|
|||||||
|
|
||||||
# The default calc versions
|
# The default calc versions
|
||||||
#
|
#
|
||||||
VERSION= 2.12.4.6
|
VERSION= 2.12.4.11
|
||||||
VERS= 2.12.4
|
VERS= 2.12.4
|
||||||
VER= 2.12
|
VER= 2.12
|
||||||
VE= 2
|
VE= 2
|
||||||
@@ -1025,11 +1025,11 @@ STRIP= strip
|
|||||||
# Extra compiling and linking flags
|
# Extra compiling and linking flags
|
||||||
#
|
#
|
||||||
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files
|
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files
|
||||||
# EXTRA_LDFLAGS are flags given to ${CC} when linking progs
|
# EXTRA_LDFLAGS are flags given to ${CC} when linking programs
|
||||||
#
|
#
|
||||||
# Both CFLAGS and LDFLAGS are left blank in this Makefile by
|
# Both CFLAGS and LDFLAGS are left blank in this Makefile by
|
||||||
# default so that users may use them on the make command line
|
# default so that users may use them on the make command line
|
||||||
# to always the way that C is compiled and files are linked
|
# to always set the way that C is compiled and files are linked
|
||||||
# respectively. For example:
|
# respectively. For example:
|
||||||
#
|
#
|
||||||
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
|
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
|
||||||
@@ -1037,18 +1037,18 @@ STRIP= strip
|
|||||||
# NOTE: These should be left blank in this Makefile to make it
|
# NOTE: These should be left blank in this Makefile to make it
|
||||||
# easier to add stuff on the command line. If you want to
|
# easier to add stuff on the command line. If you want to
|
||||||
# to change the way calc is compiled by this Makefile, change
|
# to change the way calc is compiled by this Makefile, change
|
||||||
# the appropirate host target section below or a flag above.
|
# the appropriate host target section below or a flag above.
|
||||||
#
|
#
|
||||||
EXTRA_CFLAGS=
|
EXTRA_CFLAGS=
|
||||||
EXTRA_LDFLAGS=
|
EXTRA_LDFLAGS=
|
||||||
|
|
||||||
# COMMON_CFLAGS are the common ${CC} flags used for all progs, both
|
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
||||||
# intermediate and final calc and calc related progs
|
# intermediate and final calc and calc related programs
|
||||||
#
|
#
|
||||||
COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
|
COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
|
||||||
|
|
||||||
# COMMON_LDFLAGS are the common flags used for linking all progs, both
|
# COMMON_LDFLAGS are the common flags used for linking all programs, both
|
||||||
# intermediate and final calc and calc related progs
|
# intermediate and final calc and calc related programs
|
||||||
#
|
#
|
||||||
COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
||||||
|
|
||||||
@@ -1066,16 +1066,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# BLD_TYPE= calc-static-only
|
# BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
||||||
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs
|
# DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
|
||||||
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
||||||
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib
|
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
|
||||||
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
||||||
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
||||||
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib
|
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
|
||||||
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
||||||
@@ -1088,8 +1088,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# to abort on warnings, then leave CCWERR blank.
|
# to abort on warnings, then leave CCWERR blank.
|
||||||
# CCMISC are misc flags given to ${CC}
|
# CCMISC are misc flags given to ${CC}
|
||||||
#
|
#
|
||||||
# LCC how the the C compiler is invoked on locally executed intermediate progs
|
# LCC is how the C compiler is invoked on locally executed intermediate programs
|
||||||
# CC is how the the C compiler is invoked (with an optional Purify)
|
# CC is how the C compiler is invoked (with an optional Purify)
|
||||||
#
|
#
|
||||||
# Specific target overrides or modifications to default values
|
# Specific target overrides or modifications to default values
|
||||||
|
|
||||||
@@ -1128,10 +1128,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
|
|||||||
#
|
#
|
||||||
# The simple makefile forces the use of static ${CC} flags
|
# The simple makefile forces the use of static ${CC} flags
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
||||||
CFLAGS= ${ICFLAGS} ${CCOPT}
|
CFLAGS= ${ICFLAGS} ${CCOPT}
|
||||||
@@ -1354,7 +1354,7 @@ CUSTOM_PASSDOWN= \
|
|||||||
VERSION=${VERSION} \
|
VERSION=${VERSION} \
|
||||||
target=${target}
|
target=${target}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to help/Makefile.
|
# The complete list of Makefile vars passed down to help/Makefile.
|
||||||
#
|
#
|
||||||
HELP_PASSDOWN= \
|
HELP_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1391,7 +1391,7 @@ HELP_PASSDOWN= \
|
|||||||
TOUCH=${TOUCH} \
|
TOUCH=${TOUCH} \
|
||||||
TRUE=${TRUE}
|
TRUE=${TRUE}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to cal/Makefile.
|
# The complete list of Makefile vars passed down to cal/Makefile.
|
||||||
#
|
#
|
||||||
CAL_PASSDOWN= \
|
CAL_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1419,7 +1419,7 @@ CAL_PASSDOWN= \
|
|||||||
TOUCH=${TOUCH} \
|
TOUCH=${TOUCH} \
|
||||||
TRUE=${TRUE}
|
TRUE=${TRUE}
|
||||||
|
|
||||||
# The compelte list of Makefile vars passed down to cscript/Makefile.
|
# The complete list of Makefile vars passed down to cscript/Makefile.
|
||||||
#
|
#
|
||||||
CSCRIPT_PASSDOWN= \
|
CSCRIPT_PASSDOWN= \
|
||||||
AR=${AR} \
|
AR=${AR} \
|
||||||
@@ -1468,7 +1468,7 @@ DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README \
|
|||||||
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
|
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
|
||||||
sample.README calc.spec.in rpm.mk
|
sample.README calc.spec.in rpm.mk
|
||||||
|
|
||||||
# These files are used to make (but not built) a calc .a link library
|
# These files are used to make (but not build) a calc .a link library
|
||||||
#
|
#
|
||||||
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
|
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
|
||||||
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
|
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
|
||||||
@@ -1481,18 +1481,18 @@ OBJS= ${LIBOBJS} ${CALCOBJS} ${UTIL_OBJS} ${SAMPLE_OBJ}
|
|||||||
#
|
#
|
||||||
CALC_STATIC_LIBS= libcalc.a libcustcalc.a
|
CALC_STATIC_LIBS= libcalc.a libcustcalc.a
|
||||||
|
|
||||||
# Libaraies created and used to build calc
|
# Libraries created and used to build calc
|
||||||
#
|
#
|
||||||
CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION}
|
CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION}
|
||||||
|
|
||||||
# Symlinks of dymanic shared libraries
|
# Symlinks of dynamic shared libraries
|
||||||
#
|
#
|
||||||
SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
|
SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
|
||||||
libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \
|
libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \
|
||||||
libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \
|
libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \
|
||||||
libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT}
|
libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT}
|
||||||
|
|
||||||
# list of sample programs to that need to be built to satisfy sample rule
|
# list of sample programs that need to be built to satisfy sample rule
|
||||||
#
|
#
|
||||||
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
|
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
|
||||||
# not installed at this time.
|
# not installed at this time.
|
||||||
@@ -1503,7 +1503,7 @@ SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
|
|||||||
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
|
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
|
||||||
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
|
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
|
||||||
|
|
||||||
# list of cscript programs to that need to be built to satisfy cscript/.all
|
# list of cscript programs that need to be built to satisfy cscript/.all
|
||||||
#
|
#
|
||||||
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
|
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
|
||||||
# in the cscript/Makefile
|
# in the cscript/Makefile
|
||||||
@@ -1558,7 +1558,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \
|
echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
|
||||||
echo " previously built .o, libs and executables" 1>&2; \
|
echo " previously built .o, libs and executables" 1>&2; \
|
||||||
echo " before switching to $$r!" 1>&2; \
|
echo " before switching to $$r!" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
@@ -1574,7 +1574,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "to clean out any previously build static files." 1>&2; \
|
echo "to clean out any previously built static files." 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "=== aborting make ===" 1>&2; \
|
echo "=== aborting make ===" 1>&2; \
|
||||||
exit 2; \
|
exit 2; \
|
||||||
@@ -1604,7 +1604,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \
|
echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
|
||||||
echo " previously built .o, libs and executables" 1>&2; \
|
echo " previously built .o, libs and executables" 1>&2; \
|
||||||
echo " before switching to $$r!" 1>&2; \
|
echo " before switching to $$r!" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
@@ -1620,7 +1620,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
|
|||||||
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
|
||||||
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "to clean out any previously build dynamic files." 1>&2; \
|
echo "to clean out any previously built dynamic files." 1>&2; \
|
||||||
echo "" 1>&2; \
|
echo "" 1>&2; \
|
||||||
echo "=== aborting make ===" 1>&2; \
|
echo "=== aborting make ===" 1>&2; \
|
||||||
exit 4; \
|
exit 4; \
|
||||||
@@ -1716,8 +1716,8 @@ seed.o: seed.c no_implicit.arg ${MAKE_FILE}
|
|||||||
###
|
###
|
||||||
#
|
#
|
||||||
# The next set of rules cause the .h files BUILD_H_SRC files to be built
|
# The next set of rules cause the .h files BUILD_H_SRC files to be built
|
||||||
# according tot he system and the Makefile variables above. The hsrc rule
|
# according to the system and the Makefile variables above. The hsrc rule
|
||||||
# is a convenient rule to invoke to built all of the BUILD_H_SRC.
|
# is a convenient rule to invoke to build all of the BUILD_H_SRC.
|
||||||
#
|
#
|
||||||
# We add in the BUILD_C_SRC files because they are similar to the
|
# We add in the BUILD_C_SRC files because they are similar to the
|
||||||
# BUILD_H_SRC files in terms of the build process.
|
# BUILD_H_SRC files in terms of the build process.
|
||||||
@@ -2127,8 +2127,10 @@ have_fpos.h: have_fpos.c ${MAKE_FILE}
|
|||||||
${Q} echo '' >> have_fpos.h
|
${Q} echo '' >> have_fpos.h
|
||||||
${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h
|
${Q} echo '/* do we have fgetpos & fsetpos functions? */' >> have_fpos.h
|
||||||
${Q} ${RM} -f have_fpos.o have_fpos${EXT}
|
${Q} ${RM} -f have_fpos.o have_fpos${EXT}
|
||||||
-${Q} ${LCC} ${HAVE_FPOS} ${ICFLAGS} have_fpos.c -c >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${HAVE_FPOS} ${ICFLAGS} have_fpos.c -c \
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_fpos.o -o have_fpos${EXT} >/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
|
-${Q} ${LCC} ${ILDFLAGS} have_fpos.o -o have_fpos${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_fpos${EXT} > fpos_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_fpos${EXT} > fpos_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s fpos_tmp ]; then \
|
-${Q} if [ -s fpos_tmp ]; then \
|
||||||
@@ -2213,8 +2215,9 @@ fposval.h: fposval.c have_fpos.h have_fpos_pos.h have_offscl.h have_posscl.h \
|
|||||||
${Q} echo '/* what are our file position & size types? */' >> fposval.h
|
${Q} echo '/* what are our file position & size types? */' >> fposval.h
|
||||||
${Q} ${RM} -f fposval.o fposval${EXT}
|
${Q} ${RM} -f fposval.o fposval${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${FPOS_BITS} ${OFF_T_BITS} \
|
-${Q} ${LCC} ${ICFLAGS} ${FPOS_BITS} ${OFF_T_BITS} \
|
||||||
${DEV_BITS} ${INODE_BITS} fposval.c -c >/dev/null 2>&1; ${TRUE}
|
${DEV_BITS} ${INODE_BITS} fposval.c -c >/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} fposval.o -o fposval${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} fposval.o -o fposval${EXT} >/dev/null \
|
||||||
|
2>&1; ${TRUE}
|
||||||
${Q} ${SHELL} -c "./fposval${EXT} fposv_tmp >> fposval.h 2>/dev/null" \
|
${Q} ${SHELL} -c "./fposval${EXT} fposv_tmp >> fposval.h 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
${Q} echo '' >> fposval.h
|
${Q} echo '' >> fposval.h
|
||||||
@@ -2248,7 +2251,8 @@ have_const.h: have_const.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_const.o have_const${EXT}
|
${Q} ${RM} -f have_const.o have_const${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_CONST} have_const.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_CONST} have_const.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_const.o -o have_const${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_const.o -o have_const${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_const${EXT} > const_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_const${EXT} > const_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s const_tmp ]; then \
|
-${Q} if [ -s const_tmp ]; then \
|
||||||
@@ -2382,7 +2386,8 @@ align32.h: align32.c longbits.h have_unistd.h ${MAKE_FILE}
|
|||||||
${RM} -f align32.o align32${EXT}; \
|
${RM} -f align32.o align32${EXT}; \
|
||||||
${LCC} ${ICFLAGS} ${ALIGN32} align32.c -c >/dev/null 2>&1; \
|
${LCC} ${ICFLAGS} ${ALIGN32} align32.c -c >/dev/null 2>&1; \
|
||||||
${LCC} ${ILDFLAGS} align32.o -o align32${EXT} >/dev/null 2>&1; \
|
${LCC} ${ILDFLAGS} align32.o -o align32${EXT} >/dev/null 2>&1; \
|
||||||
${SHELL} -c "./align32${EXT} >align32_tmp 2>/dev/null" >/dev/null 2>&1; \
|
${SHELL} -c \
|
||||||
|
"./align32${EXT} >align32_tmp 2>/dev/null" >/dev/null 2>&1; \
|
||||||
if [ -s align32_tmp ]; then \
|
if [ -s align32_tmp ]; then \
|
||||||
${CAT} align32_tmp >> align32.h; \
|
${CAT} align32_tmp >> align32.h; \
|
||||||
else \
|
else \
|
||||||
@@ -2423,7 +2428,8 @@ have_uid_t.h: have_uid_t.c have_unistd.h ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_uid_t.o have_uid_t${EXT}
|
${Q} ${RM} -f have_uid_t.o have_uid_t${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_UID_T} have_uid_t.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_UID_T} have_uid_t.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_uid_t.o -o have_uid_t${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_uid_t.o -o have_uid_t${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${SHELL} -c "./have_uid_t${EXT} > uid_tmp 2>/dev/null" \
|
-${Q} ${SHELL} -c "./have_uid_t${EXT} > uid_tmp 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if [ -s uid_tmp ]; then \
|
-${Q} if [ -s uid_tmp ]; then \
|
||||||
@@ -2611,7 +2617,8 @@ have_getpgid.h: have_getpgid.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f getpgid_tmp have_getpgid.h
|
${Q} ${RM} -f getpgid_tmp have_getpgid.h
|
||||||
${Q} echo 'forming have_getpgid.h'
|
${Q} echo 'forming have_getpgid.h'
|
||||||
${Q} echo '/*' > have_getpgid.h
|
${Q} echo '/*' > have_getpgid.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_getpgid.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_getpgid.h
|
||||||
${Q} echo ' */' >> have_getpgid.h
|
${Q} echo ' */' >> have_getpgid.h
|
||||||
${Q} echo '' >> have_getpgid.h
|
${Q} echo '' >> have_getpgid.h
|
||||||
${Q} echo '' >> have_getpgid.h
|
${Q} echo '' >> have_getpgid.h
|
||||||
@@ -2651,7 +2658,8 @@ have_gettime.h: have_gettime.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f gettime_tmp have_gettime.h
|
${Q} ${RM} -f gettime_tmp have_gettime.h
|
||||||
${Q} echo 'forming have_gettime.h'
|
${Q} echo 'forming have_gettime.h'
|
||||||
${Q} echo '/*' > have_gettime.h
|
${Q} echo '/*' > have_gettime.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_gettime.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_gettime.h
|
||||||
${Q} echo ' */' >> have_gettime.h
|
${Q} echo ' */' >> have_gettime.h
|
||||||
${Q} echo '' >> have_gettime.h
|
${Q} echo '' >> have_gettime.h
|
||||||
${Q} echo '' >> have_gettime.h
|
${Q} echo '' >> have_gettime.h
|
||||||
@@ -2691,7 +2699,8 @@ have_getprid.h: have_getprid.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f getprid_tmp have_getprid.h
|
${Q} ${RM} -f getprid_tmp have_getprid.h
|
||||||
${Q} echo 'forming have_getprid.h'
|
${Q} echo 'forming have_getprid.h'
|
||||||
${Q} echo '/*' > have_getprid.h
|
${Q} echo '/*' > have_getprid.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_getprid.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_getprid.h
|
||||||
${Q} echo ' */' >> have_getprid.h
|
${Q} echo ' */' >> have_getprid.h
|
||||||
${Q} echo '' >> have_getprid.h
|
${Q} echo '' >> have_getprid.h
|
||||||
${Q} echo '' >> have_getprid.h
|
${Q} echo '' >> have_getprid.h
|
||||||
@@ -2731,7 +2740,8 @@ have_urandom.h: ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f have_urandom.h
|
${Q} ${RM} -f have_urandom.h
|
||||||
${Q} echo 'forming have_urandom.h'
|
${Q} echo 'forming have_urandom.h'
|
||||||
${Q} echo '/*' > have_urandom.h
|
${Q} echo '/*' > have_urandom.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_urandom.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_urandom.h
|
||||||
${Q} echo ' */' >> have_urandom.h
|
${Q} echo ' */' >> have_urandom.h
|
||||||
${Q} echo '' >> have_urandom.h
|
${Q} echo '' >> have_urandom.h
|
||||||
${Q} echo '' >> have_urandom.h
|
${Q} echo '' >> have_urandom.h
|
||||||
@@ -2767,7 +2777,8 @@ have_rusage.h: have_rusage.c ${MAKE_FILE}
|
|||||||
${Q} ${RM} -f rusage_tmp have_rusage.h
|
${Q} ${RM} -f rusage_tmp have_rusage.h
|
||||||
${Q} echo 'forming have_rusage.h'
|
${Q} echo 'forming have_rusage.h'
|
||||||
${Q} echo '/*' > have_rusage.h
|
${Q} echo '/*' > have_rusage.h
|
||||||
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> have_rusage.h
|
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> \
|
||||||
|
have_rusage.h
|
||||||
${Q} echo ' */' >> have_rusage.h
|
${Q} echo ' */' >> have_rusage.h
|
||||||
${Q} echo '' >> have_rusage.h
|
${Q} echo '' >> have_rusage.h
|
||||||
${Q} echo '' >> have_rusage.h
|
${Q} echo '' >> have_rusage.h
|
||||||
@@ -2858,14 +2869,16 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h have_string.h
|
|||||||
${Q} ${RM} -f have_stdvs.o have_stdvs${EXT}
|
${Q} ${RM} -f have_stdvs.o have_stdvs${EXT}
|
||||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_stdvs.c -c \
|
-${Q} ${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_stdvs.c -c \
|
||||||
>/dev/null 2>&1; ${TRUE}
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} ${LCC} ${ILDFLAGS} have_stdvs.o -o have_stdvs${EXT} >/dev/null 2>&1; ${TRUE}
|
-${Q} ${LCC} ${ILDFLAGS} have_stdvs.o -o have_stdvs${EXT} \
|
||||||
|
>/dev/null 2>&1; ${TRUE}
|
||||||
-${Q} if ./have_stdvs${EXT} >>args.h 2>/dev/null; then \
|
-${Q} if ./have_stdvs${EXT} >>args.h 2>/dev/null; then \
|
||||||
${TOUCH} have_args.sh; \
|
${TOUCH} have_args.sh; \
|
||||||
else \
|
else \
|
||||||
${TRUE}; \
|
${TRUE}; \
|
||||||
fi
|
fi
|
||||||
-${Q} if [ ! -f have_args.sh ] && [ X"${HAVE_VSPRINTF}" = X ]; then \
|
-${Q} if [ ! -f have_args.sh ] && [ X"${HAVE_VSPRINTF}" = X ]; then \
|
||||||
${RM} -f have_stdvs.o have_stdvs${EXT} have_varvs.o have_varvs${EXT}; \
|
${RM} -f have_stdvs.o have_stdvs${EXT} have_varvs.o; \
|
||||||
|
${RM} -f have_varvs${EXT}; \
|
||||||
${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_varvs.c -c \
|
${LCC} ${ICFLAGS} ${HAVE_VSPRINTF} have_varvs.c -c \
|
||||||
2>/dev/null; \
|
2>/dev/null; \
|
||||||
${LCC} ${ILDFLAGS} have_varvs.o -o have_varvs${EXT} 2>/dev/null; \
|
${LCC} ${ILDFLAGS} have_varvs.o -o have_varvs${EXT} 2>/dev/null; \
|
||||||
@@ -2889,7 +2902,8 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h have_string.h
|
|||||||
${Q} echo '' >> args.h
|
${Q} echo '' >> args.h
|
||||||
${Q} echo '' >> args.h
|
${Q} echo '' >> args.h
|
||||||
${Q} echo '#endif /* !__ARGS_H__ */' >> args.h
|
${Q} echo '#endif /* !__ARGS_H__ */' >> args.h
|
||||||
${Q} ${RM} -f have_stdvs.o have_varvs.o have_varvs${EXT} have_args.sh core
|
${Q} ${RM} -f have_stdvs.o have_varvs.o have_varvs${EXT} have_args.sh
|
||||||
|
${Q} ${RM} -f core
|
||||||
${Q} echo 'args.h formed'
|
${Q} echo 'args.h formed'
|
||||||
-@if [ -z "${Q}" ]; then \
|
-@if [ -z "${Q}" ]; then \
|
||||||
echo ''; \
|
echo ''; \
|
||||||
@@ -2963,7 +2977,8 @@ no_implicit.arg: no_implicit.c ${MAKE_FILE}
|
|||||||
else \
|
else \
|
||||||
${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \
|
${LCC} -Wno-implicit ${ICFLAGS} -DHAVE_NO_IMPLICIT \
|
||||||
no_implicit.c -c >/dev/null 2>&1; \
|
no_implicit.c -c >/dev/null 2>&1; \
|
||||||
${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} >/dev/null 2>&1; \
|
${LCC} ${ILDFLAGS} no_implicit.o -o no_implicit${EXT} \
|
||||||
|
>/dev/null 2>&1; \
|
||||||
${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \
|
${SHELL} -c "./no_implicit${EXT} > no_implicit.arg 2>/dev/null" \
|
||||||
>/dev/null 2>&1; ${TRUE}; \
|
>/dev/null 2>&1; ${TRUE}; \
|
||||||
fi
|
fi
|
||||||
@@ -3146,7 +3161,7 @@ libcustcalc${LIB_EXT}: libcustcalc${LIB_EXT_VERSION}
|
|||||||
|
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# building calc-static and static lib*.a libraires
|
# building calc-static and static lib*.a libraries
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
|
|
||||||
@@ -3179,10 +3194,10 @@ sample_many-static${EXT}: sample_many.o ${CALC_STATIC_LIBS} ${MAKE_FILE}
|
|||||||
|
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# Home grown make dependency rules. Your system make not support
|
# Homegrown make dependency rules. Your system may not support
|
||||||
# or have the needed tools. You can ignore this section.
|
# or have the needed tools. You can ignore this section.
|
||||||
#
|
#
|
||||||
# We will form a skelaton tree of *.c files containing only #include "foo.h"
|
# We will form a skeleton tree of *.c files containing only #include "foo.h"
|
||||||
# lines and .h files containing the same lines surrounded by multiple include
|
# lines and .h files containing the same lines surrounded by multiple include
|
||||||
# prevention lines. This allows us to build a static depend list that will
|
# prevention lines. This allows us to build a static depend list that will
|
||||||
# satisfy all possible cpp symbol definition combinations.
|
# satisfy all possible cpp symbol definition combinations.
|
||||||
@@ -3236,7 +3251,8 @@ depend: custom/Makefile hsrc
|
|||||||
${Q} echo forming new ${MAKE_FILE}
|
${Q} echo forming new ${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE}
|
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -rf skel
|
${Q} ${RM} -rf skel
|
||||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||||
@@ -3291,21 +3307,21 @@ h_list:
|
|||||||
# 1 level version string.
|
# 1 level version string.
|
||||||
#
|
#
|
||||||
# version:
|
# version:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces the full version string. Note that the
|
# This rule produces the full version string. Note that the
|
||||||
# full version could be 4 or 3 levels long depending on the
|
# full version could be 4 or 3 levels long depending on the
|
||||||
# minor patch number.
|
# minor patch number.
|
||||||
#
|
#
|
||||||
# vers:
|
# vers:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 3 level version string.
|
# This rule produces only a 3 level version string.
|
||||||
#
|
#
|
||||||
# ver:
|
# ver:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 2 level version string.
|
# This rule produces only a 2 level version string.
|
||||||
#
|
#
|
||||||
# ve:
|
# ve:
|
||||||
# This rule simply echos the value found in this makefile.
|
# This rule simply echoes the value found in this makefile.
|
||||||
# This rule produces only a 1 level version string.
|
# This rule produces only a 1 level version string.
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
@@ -3397,7 +3413,7 @@ calcliblistfmt:
|
|||||||
#
|
#
|
||||||
# Doing a 'make chk' will cause only the context around interesting
|
# Doing a 'make chk' will cause only the context around interesting
|
||||||
# (and error) messages to be printed. Unlike 'make check', this
|
# (and error) messages to be printed. Unlike 'make check', this
|
||||||
# rule does not cause things to be built. I.e., the all rule is
|
# rule does not cause things to be built. i.e., the all rule is
|
||||||
# not invoked.
|
# not invoked.
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
@@ -3593,34 +3609,38 @@ env:
|
|||||||
|
|
||||||
mkdebug: env version.c
|
mkdebug: env version.c
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the source version =-=-=-=-='
|
@echo '=-=-=-= Determining the source version =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
||||||
-@./ver_calc${EXT}
|
-@./ver_calc${EXT}
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ all
|
@${MAKE} -f Makefile Q= V=@ all
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the binary version =-=-=-=-='
|
@echo '=-=-=-= Determining the binary version =-=-=-='
|
||||||
-@./calc${EXT} -e -q -v
|
-@./calc${EXT} -e -q -v
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
debug: env
|
debug: env
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ clobber
|
@${MAKE} -f Makefile Q= V=@ clobber
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Determining the source version =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
|
||||||
|
@echo '=-=-= this may take a bit of time =-=-='
|
||||||
|
@${MAKE} -f Makefile Q= V=@ all
|
||||||
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
|
@echo '=-=-=-= Determining the source version =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
|
||||||
-@./ver_calc${EXT}
|
-@./ver_calc${EXT}
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ all
|
@echo -n '=-=-=-= Print #defile values if custom functions '
|
||||||
@echo '=-=-=-=-= Determining the binary version =-=-=-=-='
|
@echo 'are allowed =-=-=-='
|
||||||
-@./calc${EXT} -e -q -v
|
-@./calc${EXT} -e -q -C 'print custom("sysinfo", 2);'
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ chk =-=-=-=-='
|
@echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ check =-=-=-='
|
||||||
@echo '=-=-=-=-= this may take a while =-=-=-=-='
|
@echo '=-=-= this may take a while =-=-='
|
||||||
@${MAKE} -f Makefile Q= V=@ chk
|
@${MAKE} -f Makefile Q= V=@ check
|
||||||
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-='
|
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
|
||||||
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -3685,7 +3705,8 @@ rpm-unhide-static:
|
|||||||
|
|
||||||
rpm-chk-static:
|
rpm-chk-static:
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
${CALC_ENV} ./calc-static${EXT} -d -q read regress 2>&1 | ${AWK} -f check.awk
|
${CALC_ENV} ./calc-static${EXT} -d -q read regress 2>&1 | \
|
||||||
|
${AWK} -f check.awk
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
rpm-clean-static:
|
rpm-clean-static:
|
||||||
@@ -3730,7 +3751,7 @@ inst_files: ${MAKE_FILE} help/Makefile cal/Makefile custom/Makefile \
|
|||||||
${Q} LANG=C ${SORT} -u inst_files -o inst_files
|
${Q} LANG=C ${SORT} -u inst_files -o inst_files
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
# The olduninstall rule will remove calc files from the older, histroic
|
# The olduninstall rule will remove calc files from the older, historic
|
||||||
# locations under the /usr/local directory. If you are using the
|
# locations under the /usr/local directory. If you are using the
|
||||||
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
|
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
|
||||||
# then you can use this rule to clean out the older calc stuff under
|
# then you can use this rule to clean out the older calc stuff under
|
||||||
@@ -3844,7 +3865,7 @@ clobber: custom/Makefile clean
|
|||||||
|
|
||||||
# install everything
|
# install everything
|
||||||
#
|
#
|
||||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
# NOTE: Keep the uninstall rule in the reverse order of the install rule
|
||||||
#
|
#
|
||||||
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@@ -4067,7 +4088,8 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
|||||||
continue; \
|
continue; \
|
||||||
fi; \
|
fi; \
|
||||||
${RM} -f tmp; \
|
${RM} -f tmp; \
|
||||||
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' $$i > tmp; \
|
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' \
|
||||||
|
$$i > tmp; \
|
||||||
if ${CMP} -s tmp ${T}${CALC_INCDIR}/$$i; then \
|
if ${CMP} -s tmp ${T}${CALC_INCDIR}/$$i; then \
|
||||||
${TRUE}; \
|
${TRUE}; \
|
||||||
else \
|
else \
|
||||||
@@ -4138,7 +4160,7 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
|
|||||||
|
|
||||||
# Try to remove everything that was installed
|
# Try to remove everything that was installed
|
||||||
#
|
#
|
||||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
# NOTE: Keep the uninstall rule in the reverse order of the install rule
|
||||||
#
|
#
|
||||||
uninstall: custom/Makefile
|
uninstall: custom/Makefile
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||||
@@ -4190,7 +4212,7 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}";\
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VE}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4198,7 +4220,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
echo -n "cannot uninstall "; \
|
||||||
|
echo "${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VER}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4206,7 +4229,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
echo \
|
||||||
|
"cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERS}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4214,9 +4238,10 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
${RM} -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
echo \
|
||||||
|
"cannot uninstall ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}";\
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}";\
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT}" ]; then \
|
||||||
@@ -4254,7 +4279,8 @@ uninstall: custom/Makefile
|
|||||||
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
-${Q} if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
${RM} -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
${RM} -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
if [ -f "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}" ]; then \
|
||||||
echo "cannot uninstall ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
echo -n "cannot uninstall " \
|
||||||
|
echo "${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
else \
|
else \
|
||||||
echo "uninstalled ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
echo "uninstalled ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -4338,7 +4364,7 @@ strip:
|
|||||||
done
|
done
|
||||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||||
|
|
||||||
# calc-symlink - setup symlinks from stardard locations into the ${T} tree
|
# calc-symlink - setup symlinks from standard locations into the ${T} tree
|
||||||
#
|
#
|
||||||
calc-symlink:
|
calc-symlink:
|
||||||
${Q}if [ -z "${T}" ]; then \
|
${Q}if [ -z "${T}" ]; then \
|
||||||
@@ -4372,15 +4398,20 @@ calc-symlink:
|
|||||||
done
|
done
|
||||||
-${Q} if [ -n "${CATDIR}" ]; then \
|
-${Q} if [ -n "${CATDIR}" ]; then \
|
||||||
if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
if [ ! -L "${CATDIR}/calc.${CATEXT}" -a "${T}${CATDIR}/calc.${CATEXT}" -ef "${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ ! -L "${CATDIR}/calc.${CATEXT}" -a \
|
||||||
echo "ERROR: ${T}${CATDIR}/calc.${CATEXT} is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
"${T}${CATDIR}/calc.${CATEXT}" -ef \
|
||||||
|
"${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
|
echo -n "ERROR: ${T}${CATDIR}/calc.${CATEXT}" 2>&1; \
|
||||||
|
echo "is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
||||||
else \
|
else \
|
||||||
if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \
|
if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \
|
||||||
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
fi; \
|
fi; \
|
||||||
echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \
|
echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" \
|
||||||
${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \
|
"${CATDIR}/calc.${CATEXT}"; \
|
||||||
|
${LN} -s "${T}${CATDIR}/calc.${CATEXT}" \
|
||||||
|
"${CATDIR}/calc.${CATEXT}"; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
@@ -4409,7 +4440,8 @@ calc-unsymlink:
|
|||||||
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
${RM} -f "${CATDIR}/calc.${CATEXT}"; \
|
||||||
else \
|
else \
|
||||||
echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" 1>&2; \
|
echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" \
|
||||||
|
1>&2; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
10
alloc.h
10
alloc.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: alloc.h,v 30.2 2008/04/15 21:17:57 chongo Exp $
|
* @(#) $Id: alloc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:29
|
* Under source code control: 1990/02/15 01:48:29
|
||||||
@@ -53,7 +53,8 @@
|
|||||||
# if defined(HAVE_NEWSTR)
|
# if defined(HAVE_NEWSTR)
|
||||||
E_FUNC void *memcpy();
|
E_FUNC void *memcpy();
|
||||||
E_FUNC void *memset();
|
E_FUNC void *memset();
|
||||||
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
#if defined(FORCE_STDC) || \
|
||||||
|
(defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
||||||
E_FUNC size_t strlen();
|
E_FUNC size_t strlen();
|
||||||
# else
|
# else
|
||||||
E_FUNC long strlen();
|
E_FUNC long strlen();
|
||||||
@@ -82,7 +83,8 @@ E_FUNC int strcmp();
|
|||||||
|
|
||||||
#if !defined(HAVE_MEMMOVE)
|
#if !defined(HAVE_MEMMOVE)
|
||||||
# undef MEMMOVE_SIZE_T
|
# undef MEMMOVE_SIZE_T
|
||||||
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
#if defined(FORCE_STDC) || \
|
||||||
|
(defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
||||||
# define MEMMOVE_SIZE_T size_t
|
# define MEMMOVE_SIZE_T size_t
|
||||||
# else
|
# else
|
||||||
# define MEMMOVE_SIZE_T long
|
# define MEMMOVE_SIZE_T long
|
||||||
|
10
assocfunc.c
10
assocfunc.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: assocfunc.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: assocfunc.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/assocfunc.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/assocfunc.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/20 23:04:27
|
* Under source code control: 1993/07/20 23:04:27
|
||||||
@@ -332,7 +332,8 @@ assoccopy(ASSOC *oldap)
|
|||||||
oldep = oldep->e_next) {
|
oldep = oldep->e_next) {
|
||||||
ep = (ASSOCELEM *) malloc(ELEMSIZE(oldep->e_dim));
|
ep = (ASSOCELEM *) malloc(ELEMSIZE(oldep->e_dim));
|
||||||
if (ep == NULL) {
|
if (ep == NULL) {
|
||||||
math_error("Cannot allocate association element");
|
math_error("Cannot allocate "
|
||||||
|
"association element");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
ep->e_dim = oldep->e_dim;
|
ep->e_dim = oldep->e_dim;
|
||||||
@@ -340,7 +341,8 @@ assoccopy(ASSOC *oldap)
|
|||||||
ep->e_value.v_type = V_NULL;
|
ep->e_value.v_type = V_NULL;
|
||||||
ep->e_value.v_subtype = V_NOSUBTYPE;
|
ep->e_value.v_subtype = V_NOSUBTYPE;
|
||||||
for (i = 0; i < ep->e_dim; i++)
|
for (i = 0; i < ep->e_dim; i++)
|
||||||
copyvalue(&oldep->e_indices[i], &ep->e_indices[i]);
|
copyvalue(&oldep->e_indices[i],
|
||||||
|
&ep->e_indices[i]);
|
||||||
copyvalue(&oldep->e_value, &ep->e_value);
|
copyvalue(&oldep->e_value, &ep->e_value);
|
||||||
listhead = &ap->a_table[ep->e_hash % ap->a_size];
|
listhead = &ap->a_table[ep->e_hash % ap->a_size];
|
||||||
ep->e_next = *listhead;
|
ep->e_next = *listhead;
|
||||||
|
19
blkcpy.c
19
blkcpy.c
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: blkcpy.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: blkcpy.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/04/18 20:41:26
|
* Under source code control: 1997/04/18 20:41:26
|
||||||
@@ -374,7 +374,8 @@ copyblk2mat(BLOCK *blk, long ssi, long num, MATRIX *dmat, long dsi)
|
|||||||
* copymat2blk - copy matrix to block
|
* copymat2blk - copy matrix to block
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copymat2blk(MATRIX *smat, long ssi, long num, BLOCK *dblk, long dsi, BOOL noreloc)
|
copymat2blk(MATRIX *smat, long ssi, long num, BLOCK *dblk, long dsi,
|
||||||
|
BOOL noreloc)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
long newlen;
|
long newlen;
|
||||||
@@ -720,7 +721,8 @@ copystr2file(STRING *str, long ssi, long num, FILEID id, long dsi)
|
|||||||
* copyblk2blk - copy block to block
|
* copyblk2blk - copy block to block
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copyblk2blk(BLOCK *sblk, long ssi, long num, BLOCK *dblk, long dsi, BOOL noreloc)
|
copyblk2blk(BLOCK *sblk, long ssi, long num, BLOCK *dblk, long dsi,
|
||||||
|
BOOL noreloc)
|
||||||
{
|
{
|
||||||
long newlen;
|
long newlen;
|
||||||
long newsize;
|
long newsize;
|
||||||
@@ -762,7 +764,8 @@ copyblk2blk(BLOCK *sblk, long ssi, long num, BLOCK *dblk, long dsi, BOOL noreloc
|
|||||||
* copystr2blk - copy string to block
|
* copystr2blk - copy string to block
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copystr2blk(STRING *str, long ssi, long num, BLOCK *dblk, long dsi, BOOL noreloc)
|
copystr2blk(STRING *str, long ssi, long num, BLOCK *dblk, long dsi,
|
||||||
|
BOOL noreloc)
|
||||||
{
|
{
|
||||||
long len;
|
long len;
|
||||||
long newlen;
|
long newlen;
|
||||||
@@ -982,7 +985,8 @@ memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n)
|
|||||||
* copynum2blk - copy number numerator to block
|
* copynum2blk - copy number numerator to block
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copynum2blk(NUMBER *snum, long ssi, long num, BLOCK *dblk, long dsi, BOOL noreloc)
|
copynum2blk(NUMBER *snum, long ssi, long num, BLOCK *dblk, long dsi,
|
||||||
|
BOOL noreloc)
|
||||||
{
|
{
|
||||||
size_t newlen;
|
size_t newlen;
|
||||||
size_t newsize;
|
size_t newsize;
|
||||||
@@ -1033,7 +1037,8 @@ copynum2blk(NUMBER *snum, long ssi, long num, BLOCK *dblk, long dsi, BOOL norelo
|
|||||||
* copyblk2num - copy block to number
|
* copyblk2num - copy block to number
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
copyblk2num(BLOCK *sblk, long ssi, long num, NUMBER *dnum, long dsi, NUMBER **res)
|
copyblk2num(BLOCK *sblk, long ssi, long num, NUMBER *dnum, long dsi,
|
||||||
|
NUMBER **res)
|
||||||
{
|
{
|
||||||
size_t newlen;
|
size_t newlen;
|
||||||
NUMBER *ret; /* cloned and modified numerator */
|
NUMBER *ret; /* cloned and modified numerator */
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: byteswap.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: byteswap.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/10/11 04:44:01
|
* Under source code control: 1995/10/11 04:44:01
|
||||||
@@ -102,7 +102,8 @@ swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all)
|
|||||||
*/
|
*/
|
||||||
dest = malloc(sizeof(ZVALUE));
|
dest = malloc(sizeof(ZVALUE));
|
||||||
if (dest == NULL) {
|
if (dest == NULL) {
|
||||||
math_error("swap_b8_in_ZVALUE: swap_b8_in_ZVALUE: Not enough memory");
|
math_error("swap_b8_in_ZVALUE: swap_b8_in_ZVALUE: "
|
||||||
|
"Not enough memory");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
cal/Makefile
34
cal/Makefile
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.5 $
|
# @(#) $Revision: 30.7 $
|
||||||
# @(#) $Id: Makefile,v 30.5 2011/05/23 22:50:18 chongo Exp $
|
# @(#) $Id: Makefile,v 30.7 2013/08/11 09:07:26 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1991/07/21 05:00:54
|
# Under source code control: 1991/07/21 05:00:54
|
||||||
@@ -182,19 +182,21 @@ TOUCH= touch
|
|||||||
|
|
||||||
# The calc files to install
|
# The calc files to install
|
||||||
#
|
#
|
||||||
CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \
|
CALC_FILES= alg_config.cal beer.cal bernoulli.cal bernpoly.cal \
|
||||||
lucas_tbl.cal mersenne.cal mod.cal pell.cal pi.cal pix.cal \
|
bigprime.cal bindings brentsolve.cal chi.cal chrem.cal constants.cal \
|
||||||
pollard.cal poly.cal psqrt.cal quat.cal regress.cal solve.cal \
|
deg.cal dms.cal dotest.cal ellip.cal factorial2.cal factorial.cal \
|
||||||
sumsq.cal surd.cal unitfrac.cal varargs.cal chrem.cal mfactor.cal \
|
gvec.cal hello.cal hms.cal intfile.cal lambertw.cal linear.cal \
|
||||||
bindings randmprime.cal test1700.cal randrun.cal linear.cal \
|
lnseries.cal lucas.cal lucas_chk.cal lucas_tbl.cal mersenne.cal \
|
||||||
randbitrun.cal bernoulli.cal test2300.cal test2600.cal \
|
mfactor.cal mod.cal natnumset.cal pell.cal pi.cal pix.cal pollard.cal \
|
||||||
test2700.cal test3100.cal test3300.cal test3400.cal prompt.cal \
|
poly.cal prompt.cal psqrt.cal qtime.cal quat.cal randbitrun.cal \
|
||||||
test3500.cal seedrandom.cal test4000.cal test4100.cal test4600.cal \
|
randmprime.cal randombitrun.cal randomrun.cal randrun.cal README \
|
||||||
beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \
|
regress.cal repeat.cal screen.cal seedrandom.cal set8700.cal \
|
||||||
randomrun.cal repeat.cal xx_print.cal natnumset.cal qtime.cal \
|
set8700.line solve.cal specialfunctions.cal statistics.cal sumsq.cal \
|
||||||
test8400.cal test8500.cal test8600.cal chi.cal intfile.cal screen.cal \
|
sumtimes.cal surd.cal test1700.cal test2300.cal test2600.cal \
|
||||||
dotest.cal set8700.cal set8700.line alg_config.cal sumtimes.cal \
|
test2700.cal test3100.cal test3300.cal test3400.cal test3500.cal \
|
||||||
dms.cal hms.cal gvec.cal
|
test4000.cal test4100.cal test4600.cal test5100.cal test5200.cal \
|
||||||
|
test8400.cal test8500.cal test8600.cal test8900.cal toomcook.cal \
|
||||||
|
unitfrac.cal varargs.cal xx_print.cal zeta2.cal
|
||||||
|
|
||||||
# These files are found (but not built) in the distribution
|
# These files are found (but not built) in the distribution
|
||||||
#
|
#
|
||||||
@@ -293,7 +295,7 @@ install: all
|
|||||||
${RM} -f ${T}${CALC_SHAREDIR}/$$i.new; \
|
${RM} -f ${T}${CALC_SHAREDIR}/$$i.new; \
|
||||||
${CP} -f $$i ${T}${CALC_SHAREDIR}/$$i.new; \
|
${CP} -f $$i ${T}${CALC_SHAREDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${T}${CALC_SHAREDIR}/$$i.new; \
|
${CHMOD} 0444 ${T}${CALC_SHAREDIR}/$$i.new; \
|
||||||
${MV} -f ${T}${CALC_SHAREDIR}/$$i.new ${T}${CALC_SHAREDIR}/$$i; \
|
${MV} -f ${T}${CALC_SHAREDIR}/$$i.new ${T}${CALC_SHAREDIR}/$$i;\
|
||||||
echo "installed ${T}${CALC_SHAREDIR}/$$i"; \
|
echo "installed ${T}${CALC_SHAREDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
767
cal/README
767
cal/README
@@ -173,7 +173,8 @@ alg_config.cal
|
|||||||
|
|
||||||
beer.cal
|
beer.cal
|
||||||
|
|
||||||
Calc's contribution to the 99 Bottles of Beer web page:
|
This calc resource is calc's contribution to the 99 Bottles of Beer
|
||||||
|
web page:
|
||||||
|
|
||||||
http://www.ionet.net/~timtroyr/funhouse/beer.html#calc
|
http://www.ionet.net/~timtroyr/funhouse/beer.html#calc
|
||||||
|
|
||||||
@@ -191,6 +192,18 @@ bernoulli.cal
|
|||||||
the builtin function.
|
the builtin function.
|
||||||
|
|
||||||
|
|
||||||
|
bernpoly.cal
|
||||||
|
|
||||||
|
bernpoly(n,z)
|
||||||
|
|
||||||
|
Computes the nth Bernoulli polynomial at z for arbitrary n,z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Bernoulli_polynomials
|
||||||
|
http://mathworld.wolfram.com/BernoulliPolynomial.html
|
||||||
|
|
||||||
|
for further information
|
||||||
|
|
||||||
|
|
||||||
bigprime.cal
|
bigprime.cal
|
||||||
|
|
||||||
bigprime(a, m, p)
|
bigprime(a, m, p)
|
||||||
@@ -198,6 +211,34 @@ bigprime.cal
|
|||||||
A prime test, base a, on p*2^x+1 for even x>m.
|
A prime test, base a, on p*2^x+1 for even x>m.
|
||||||
|
|
||||||
|
|
||||||
|
brentsolve.cal
|
||||||
|
|
||||||
|
brentsolve(low, high,eps)
|
||||||
|
|
||||||
|
A root-finder implementwed with the Brent-Dekker trick.
|
||||||
|
|
||||||
|
brentsolve2(low, high,which,eps)
|
||||||
|
|
||||||
|
The second function, brentsolve2(low, high,which,eps) has some lines
|
||||||
|
added to make it easier to hardcode the name of the helper function
|
||||||
|
different from the obligatory "f".
|
||||||
|
|
||||||
|
See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Brent%27s_method
|
||||||
|
http://mathworld.wolfram.com/BrentsMethod.html
|
||||||
|
|
||||||
|
to find out more about the Brent-Dekker method.
|
||||||
|
|
||||||
|
|
||||||
|
constants.cal
|
||||||
|
|
||||||
|
e()
|
||||||
|
G()
|
||||||
|
|
||||||
|
An implementation of different constants to arbitrary precision.
|
||||||
|
|
||||||
|
|
||||||
chi.cal
|
chi.cal
|
||||||
|
|
||||||
Z(x[, eps])
|
Z(x[, eps])
|
||||||
@@ -291,6 +332,166 @@ dotest.cal
|
|||||||
dotest("set8700.line");
|
dotest("set8700.line");
|
||||||
|
|
||||||
|
|
||||||
|
factorial.cal
|
||||||
|
|
||||||
|
factorial(n)
|
||||||
|
|
||||||
|
Calculates the product of the positive integers up to and including n.
|
||||||
|
|
||||||
|
See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Factorial
|
||||||
|
|
||||||
|
for information on the factorial. This function depends on the script
|
||||||
|
toomcook.cal.
|
||||||
|
|
||||||
|
|
||||||
|
primorial(a,b)
|
||||||
|
|
||||||
|
Calculates the product of the primes between a and b. If a is not prime
|
||||||
|
the next higher prime is taken as the starting point. If b is not prime
|
||||||
|
the next lower prime is taking as the end point b. The end point b must
|
||||||
|
not exceed 4294967291. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Primorial
|
||||||
|
|
||||||
|
for information on the primorial.
|
||||||
|
|
||||||
|
|
||||||
|
factorial2.cal
|
||||||
|
|
||||||
|
This file contents a small variety of integer functions that can, with
|
||||||
|
more or less pressure, be related to the factorial.
|
||||||
|
|
||||||
|
doublefactorial(n)
|
||||||
|
|
||||||
|
Calculates the double factorial n!! with different algorithms for
|
||||||
|
- n odd
|
||||||
|
- n even and positive
|
||||||
|
- n (real|complex) sans the negative half integers
|
||||||
|
|
||||||
|
See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Double_factorial
|
||||||
|
http://mathworld.wolfram.com/DoubleFactorial.html
|
||||||
|
|
||||||
|
for information on the double factorial. This function depends on
|
||||||
|
the script toomcook.cal, factorial.cal and specialfunctions.cal.
|
||||||
|
|
||||||
|
|
||||||
|
binomial(n,k)
|
||||||
|
|
||||||
|
Calculates the binomial coefficients for n large and k = k \pm
|
||||||
|
n/2. Defaults to the built-in function for smaller and/or different
|
||||||
|
values. Meant as a complete replacement for comb(n,k) with only a
|
||||||
|
very small overhead. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Binomial_coefficient
|
||||||
|
|
||||||
|
for information on the binomial. This function depends on the script
|
||||||
|
toomcook.cal factorial.cal and specialfunctions.cal.
|
||||||
|
|
||||||
|
|
||||||
|
bigcatalan(n)
|
||||||
|
|
||||||
|
Calculates the n-th Catalan number for n large. It is usefull
|
||||||
|
above n~50,000 but defaults to the builtin function for smaller
|
||||||
|
values.Meant as a complete replacement for catalan(n) with only a
|
||||||
|
very small overhead. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Catalan_number
|
||||||
|
http://mathworld.wolfram.com/CatalanNumber.html
|
||||||
|
|
||||||
|
for information on Catalan numbers. This function depends on the scripts
|
||||||
|
toomcook.cal, factorial.cal and specialfunctions.cal.
|
||||||
|
|
||||||
|
|
||||||
|
stirling1(n,m)
|
||||||
|
|
||||||
|
Calculates the Stirling number of the first kind. It does so with
|
||||||
|
building a list of all of the smaller results. It might be a good
|
||||||
|
idea, though, to run it once for the highest n,m first if many
|
||||||
|
Stirling numbers are needed at once, for example in a series. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Stirling_numbers_of_the_first_kind
|
||||||
|
http://mathworld.wolfram.com/StirlingNumberoftheFirstKind.html
|
||||||
|
Algorithm 3.17, Donald Kreher and Douglas Simpson, "Combinatorial
|
||||||
|
Algorithms", CRC Press, 1998, page 89.
|
||||||
|
|
||||||
|
for information on Stirling numbers of the first kind.
|
||||||
|
|
||||||
|
|
||||||
|
stirling2(n,m)
|
||||||
|
stirling2caching(n,m)
|
||||||
|
|
||||||
|
Calculate the Stirling number of the second kind.
|
||||||
|
The first function stirling2(n,m) does it with the sum
|
||||||
|
m
|
||||||
|
====
|
||||||
|
1 \ n m - k
|
||||||
|
-- > k (- 1) binomial(m, k)
|
||||||
|
m! /
|
||||||
|
====
|
||||||
|
k = 0
|
||||||
|
|
||||||
|
The other function stirling2caching(n,m) does it by way of the
|
||||||
|
reccurence relation and keeps all earlier results. This function
|
||||||
|
is much slower for computing a single value than stirling2(n,m) but
|
||||||
|
is very usefull if many Stirling numbers are needed, for example in
|
||||||
|
a series. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind
|
||||||
|
http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html
|
||||||
|
|
||||||
|
Algorithm 3.17, Donald Kreher and Douglas Simpson, "Combinatorial
|
||||||
|
Algorithms", CRC Press, 1998, page 89.
|
||||||
|
|
||||||
|
for information on Stirling numbers of the second kind.
|
||||||
|
|
||||||
|
|
||||||
|
bell(n)
|
||||||
|
|
||||||
|
Calculate the n-th Bell number. This may take some time for large n.
|
||||||
|
See:
|
||||||
|
|
||||||
|
http://oeis.org/A000110
|
||||||
|
http://en.wikipedia.org/wiki/Bell_number
|
||||||
|
http://mathworld.wolfram.com/BellNumber.html
|
||||||
|
|
||||||
|
for information on Bell numbers.
|
||||||
|
|
||||||
|
|
||||||
|
subfactorial(n)
|
||||||
|
|
||||||
|
Calculate the n-th subfactorial or derangement. This may take some
|
||||||
|
time for large n. See:
|
||||||
|
|
||||||
|
http://mathworld.wolfram.com/Derangement.html
|
||||||
|
http://en.wikipedia.org/wiki/Derangement
|
||||||
|
|
||||||
|
for information on subfactorials.
|
||||||
|
|
||||||
|
|
||||||
|
risingfactorial(x,n)
|
||||||
|
|
||||||
|
Calculates the rising factorial or Pochammer symbol of almost arbitrary
|
||||||
|
x,n. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Pochhammer_symbol
|
||||||
|
http://mathworld.wolfram.com/PochhammerSymbol.html
|
||||||
|
|
||||||
|
for information on rising factorials.
|
||||||
|
|
||||||
|
fallingfactorial(x,n)
|
||||||
|
|
||||||
|
Calculates the rising factorial of almost arbitrary x,n. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Pochhammer_symbol
|
||||||
|
http://mathworld.wolfram.com/PochhammerSymbol.html
|
||||||
|
|
||||||
|
for information on falling factorials.
|
||||||
|
|
||||||
|
|
||||||
ellip.cal
|
ellip.cal
|
||||||
|
|
||||||
efactor(iN, ia, B, force)
|
efactor(iN, ia, B, force)
|
||||||
@@ -336,6 +537,20 @@ hms.cal
|
|||||||
Calculate in hours, minutes, and seconds. See also dmscal.
|
Calculate in hours, minutes, and seconds. See also dmscal.
|
||||||
|
|
||||||
|
|
||||||
|
infinities.cal
|
||||||
|
|
||||||
|
isinfinite(x)
|
||||||
|
iscinf(x)
|
||||||
|
ispinf(x)
|
||||||
|
isninf(x)
|
||||||
|
cinf()
|
||||||
|
ninf()
|
||||||
|
pinf()
|
||||||
|
|
||||||
|
The symbolic handling of infinities. Needed for intnum.cal but might be
|
||||||
|
usefull elsewhere, too.
|
||||||
|
|
||||||
|
|
||||||
intfile.cal
|
intfile.cal
|
||||||
|
|
||||||
file2be(filename)
|
file2be(filename)
|
||||||
@@ -363,6 +578,158 @@ intfile.cal
|
|||||||
of the integer become the last octets of the file.
|
of the integer become the last octets of the file.
|
||||||
|
|
||||||
|
|
||||||
|
intnum.cal
|
||||||
|
|
||||||
|
quadtsdeletenodes()
|
||||||
|
quadtscomputenodes(order, expo, eps)
|
||||||
|
quadtscore(a, b, n)
|
||||||
|
quadts(a, b, points)
|
||||||
|
quadglcomputenodes(N)
|
||||||
|
quadgldeletenodes()
|
||||||
|
quadglcore(a, b, n)
|
||||||
|
quadgl(a, b, points)
|
||||||
|
quad(a, b, points = -1, method = "tanhsinh")
|
||||||
|
makerange(start, end, steps)
|
||||||
|
makecircle(radius, center, points)
|
||||||
|
makeellipse(angle, a, b, center, points)
|
||||||
|
makepoints()
|
||||||
|
|
||||||
|
This file offers some methods for numerical integration. Implemented are
|
||||||
|
the Gauss-Legendre and the tanh-sinh quadrature.
|
||||||
|
|
||||||
|
All functions are usefull to some extend but the main function for
|
||||||
|
quadrature is quad(), which is not much more than an abstraction layer.
|
||||||
|
|
||||||
|
The main workers are quadgl() for Gauss-legendre and quadts() for the
|
||||||
|
tanh-sinh quadrature. The limits of the integral can be anything in the
|
||||||
|
complex plane and the extended real line. The latter means that infinite
|
||||||
|
limits are supported by way of the smbolic infinities implemented in the
|
||||||
|
file infinities.cal (automatically linked in by intnum.cal).
|
||||||
|
|
||||||
|
Integration in parts and contour is supported by the "points" argument
|
||||||
|
which takes either a number or a list. the functions starting with "make"
|
||||||
|
allow for a less error prone use.
|
||||||
|
|
||||||
|
The function to evaluate must have the name "f".
|
||||||
|
|
||||||
|
Examples (shamelessly stolen from mpmath):
|
||||||
|
|
||||||
|
; define f(x){return sin(x);}
|
||||||
|
f(x) defined
|
||||||
|
; quadts(0,pi()) - 2
|
||||||
|
0.00000000000000000000
|
||||||
|
; quadgl(0,pi()) - 2
|
||||||
|
0.00000000000000000000
|
||||||
|
|
||||||
|
Sometimes rounding errors accumulate, it might be a good idea to crank up
|
||||||
|
the working precision a notch or two.
|
||||||
|
|
||||||
|
; define f(x){ return exp(-x^2);}
|
||||||
|
f(x) redefined
|
||||||
|
; quadts(0,pinf()) - pi()
|
||||||
|
0.00000000000000000000
|
||||||
|
; quadgl(0,pinf()) - pi()
|
||||||
|
0.00000000000000000001
|
||||||
|
|
||||||
|
; define f(x){ return exp(-x^2);}
|
||||||
|
f(x) redefined
|
||||||
|
; quadgl(ninf(),pinf()) - sqrt(pi())
|
||||||
|
0.00000000000000000000
|
||||||
|
; quadts(ninf(),pinf()) - sqrt(pi())
|
||||||
|
-0.00000000000000000000
|
||||||
|
|
||||||
|
Using the "points" parameter is a bit tricky
|
||||||
|
|
||||||
|
; define f(x){ return 1/x; }
|
||||||
|
f(x) redefined
|
||||||
|
; quadts(1,1,mat[3]={1i,-1,-1i}) - 2i*pi()
|
||||||
|
0.00000000000000000001i
|
||||||
|
; quadgl(1,1,mat[3]={1i,-1,-1i}) - 2i*pi()
|
||||||
|
0.00000000000000000001i
|
||||||
|
|
||||||
|
The make* functions make it a bit simpler
|
||||||
|
|
||||||
|
; quadts(1,1,makepoints(1i,-1,-1i)) - 2i*pi()
|
||||||
|
0.00000000000000000001i
|
||||||
|
; quadgl(1,1,makepoints(1i,-1,-1i)) - 2i*pi()
|
||||||
|
0.00000000000000000001i
|
||||||
|
|
||||||
|
; define f(x){ return abs(sin(x));}
|
||||||
|
f(x) redefined
|
||||||
|
; quadts(0,2*pi(),makepoints(pi())) - 4
|
||||||
|
0.00000000000000000000
|
||||||
|
; quadgl(0,2*pi(),makepoints(pi())) - 4
|
||||||
|
0.00000000000000000000
|
||||||
|
|
||||||
|
The quad*core functions do not offer anything fancy but the third parameter
|
||||||
|
controls the so called "order" which is just the number of nodes computed.
|
||||||
|
This can be quite usefull in some circumstances.
|
||||||
|
|
||||||
|
; quadgldeletenodes()
|
||||||
|
; define f(x){ return exp(x);}
|
||||||
|
f(x) redefined
|
||||||
|
; s=usertime();quadglcore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
0.00000000000000000001
|
||||||
|
2.632164
|
||||||
|
; s=usertime();quadglcore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
0.00000000000000000001
|
||||||
|
0.016001
|
||||||
|
; quadgldeletenodes()
|
||||||
|
; s=usertime();quadglcore(-3,3,14)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000000
|
||||||
|
0.024001
|
||||||
|
; s=usertime();quadglcore(-3,3,14)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000000
|
||||||
|
0
|
||||||
|
|
||||||
|
It is not much but can sum up. The tanh-sinh algorithm is not optimizable
|
||||||
|
as much as the Gauss-Legendre algorithm but is per se much faster.
|
||||||
|
|
||||||
|
; s=usertime();quadtscore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000001
|
||||||
|
0.128008
|
||||||
|
; s=usertime();quadtscore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000001
|
||||||
|
0.036002
|
||||||
|
; s=usertime();quadtscore(-3,3,49)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000000
|
||||||
|
0.036002
|
||||||
|
; s=usertime();quadtscore(-3,3,49)- (exp(3)-exp(-3));e=usertime();e-s
|
||||||
|
-0.00000000000000000000
|
||||||
|
0.01200
|
||||||
|
|
||||||
|
|
||||||
|
lambertw.cal
|
||||||
|
|
||||||
|
lambertw(z,branch)
|
||||||
|
|
||||||
|
Computes Lambert's W-function at "z" at branch "branch". See
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Lambert_W_function
|
||||||
|
http://mathworld.wolfram.com/LambertW-Function.html
|
||||||
|
https://cs.uwaterloo.ca/research/tr/1993/03/W.pdf
|
||||||
|
http://arxiv.org/abs/1003.1628
|
||||||
|
|
||||||
|
to get more information.
|
||||||
|
|
||||||
|
This file includes also an implementation for the series described in
|
||||||
|
Corless et al. (1996) eq. 4.22 (W-pdf) and Verebic (2010) (arxive link)
|
||||||
|
eqs.35-37.
|
||||||
|
|
||||||
|
The series has been implemented to get a different algorithm
|
||||||
|
for checking the results. This was necessary because the results
|
||||||
|
of the implementation in Maxima, the only program with a general
|
||||||
|
lambert-w implementation at hand at that time, differed slightly. The
|
||||||
|
Maxima versions tested were: Maxima 5.21.1 and 5.29.1. The current
|
||||||
|
version of this code concurs with the results of Mathematica`s(tm)
|
||||||
|
ProductLog[branch,z] with the tested values.
|
||||||
|
|
||||||
|
The series is only valid for the branches 0,-1, real z, converges
|
||||||
|
for values of z _very_ near the branchpoint -exp(-1) only, and must
|
||||||
|
be given the branches explicitly. See the code in lambertw.cal
|
||||||
|
for further information.
|
||||||
|
|
||||||
|
|
||||||
linear.cal
|
linear.cal
|
||||||
|
|
||||||
linear(x0, y0, x1, y1, x)
|
linear(x0, y0, x1, y1, x)
|
||||||
@@ -371,6 +738,24 @@ linear.cal
|
|||||||
Requires x0 != y0.
|
Requires x0 != y0.
|
||||||
|
|
||||||
|
|
||||||
|
lnseries.cal
|
||||||
|
|
||||||
|
lnseries(limit)
|
||||||
|
lnfromseries(n)
|
||||||
|
deletelnseries()
|
||||||
|
|
||||||
|
Calculates a series of n natural logarithms at 1,2,3,4...n. It
|
||||||
|
does so by computing the prime factorization of all of the number
|
||||||
|
sequence 1,2,3...n, calculates the natural logarithms of the primes
|
||||||
|
in 1,2,3...n and uses the above factorization to build the natural
|
||||||
|
logarithms of the rest of the sequence by sadding the logarithms of
|
||||||
|
the primes in the factorization. This is faster for high precision
|
||||||
|
of the logarithms and/or long sequences.
|
||||||
|
|
||||||
|
The sequence need to be initiated by running either lnseries(n) or
|
||||||
|
lnfromseries(n) once with n the upper limit of the sequence.
|
||||||
|
|
||||||
|
|
||||||
lucas.cal
|
lucas.cal
|
||||||
|
|
||||||
lucas(h, n)
|
lucas(h, n)
|
||||||
@@ -416,6 +801,7 @@ mfactor.cal
|
|||||||
fastest even thought the initial startup overhead is larger than
|
fastest even thought the initial startup overhead is larger than
|
||||||
for p_elim == 13.
|
for p_elim == 13.
|
||||||
|
|
||||||
|
|
||||||
mod.cal
|
mod.cal
|
||||||
|
|
||||||
lmod(a)
|
lmod(a)
|
||||||
@@ -505,6 +891,7 @@ pi.cal
|
|||||||
Lambert Meertens. See also the ABC Programmer's Handbook, by Geurts,
|
Lambert Meertens. See also the ABC Programmer's Handbook, by Geurts,
|
||||||
Meertens & Pemberton, published by Prentice-Hall (UK) Ltd., 1990.
|
Meertens & Pemberton, published by Prentice-Hall (UK) Ltd., 1990.
|
||||||
|
|
||||||
|
|
||||||
pix.cal
|
pix.cal
|
||||||
|
|
||||||
pi_of_x(x)
|
pi_of_x(x)
|
||||||
@@ -587,10 +974,10 @@ randmprime.cal
|
|||||||
|
|
||||||
randmprime(bits, seed [,dbg])
|
randmprime(bits, seed [,dbg])
|
||||||
|
|
||||||
Find a prime of the form h*2^n-1 >= 2^bits for some given x. The initial
|
Find a prime of the form h*2^n-1 >= 2^bits for some given x. The
|
||||||
search points for 'h' and 'n' are selected by a cryptographic pseudo-random
|
initial search points for 'h' and 'n' are selected by a cryptographic
|
||||||
number generator. The optional argument, dbg, if set to 1, 2 or 3
|
pseudo-random number generator. The optional argument, dbg, if set
|
||||||
turn on various debugging print statements.
|
to 1, 2 or 3 turn on various debugging print statements.
|
||||||
|
|
||||||
|
|
||||||
randombitrun.cal
|
randombitrun.cal
|
||||||
@@ -642,8 +1029,8 @@ repeat.cal
|
|||||||
|
|
||||||
regress.cal
|
regress.cal
|
||||||
|
|
||||||
Test the correct execution of the calculator by reading this resource file.
|
Test the correct execution of the calculator by reading this resource
|
||||||
Errors are reported with '****' messages, or worse. :-)
|
file. Errors are reported with '****' messages, or worse. :-)
|
||||||
|
|
||||||
|
|
||||||
screen.cal
|
screen.cal
|
||||||
@@ -689,15 +1076,17 @@ screen.cal
|
|||||||
Cyan
|
Cyan
|
||||||
White
|
White
|
||||||
|
|
||||||
Define ANSI control sequences providing (i.e., cursor movement, changing
|
Define ANSI control sequences providing (i.e., cursor movement,
|
||||||
foreground or background color, etc.) for VT100 terminals and terminal
|
changing foreground or background color, etc.) for VT100 terminals
|
||||||
window emulators (i.e., xterm, Apple OS/X Terminal, etc.) that support them.
|
and terminal window emulators (i.e., xterm, Apple OS/X Terminal,
|
||||||
|
etc.) that support them.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
read screen
|
read screen
|
||||||
print green:"This is green. ":red:"This is red.":black
|
print green:"This is green. ":red:"This is red.":black
|
||||||
|
|
||||||
|
|
||||||
seedrandom.cal
|
seedrandom.cal
|
||||||
|
|
||||||
seedrandom(seed1, seed2, bitsize [,trials])
|
seedrandom(seed1, seed2, bitsize [,trials])
|
||||||
@@ -734,13 +1123,284 @@ set8700.line
|
|||||||
The set8700.cal file (and dotest.cal) should be read first.
|
The set8700.cal file (and dotest.cal) should be read first.
|
||||||
|
|
||||||
|
|
||||||
|
smallfactors.cal
|
||||||
|
|
||||||
|
smallfactors(x0)
|
||||||
|
printsmallfactors(flist)
|
||||||
|
|
||||||
|
Lists the prime factors of numbers smaller than 2^32. Try for example:
|
||||||
|
printsmallfactors(smallfactors(10!)).
|
||||||
|
|
||||||
|
|
||||||
solve.cal
|
solve.cal
|
||||||
|
|
||||||
solve(low, high, epsilon)
|
solve(low, high, epsilon)
|
||||||
|
|
||||||
Solve the equation f(x) = 0 to within the desired error value for x.
|
Solve the equation f(x) = 0 to within the desired error value for x.
|
||||||
The function 'f' must be defined outside of this routine, and the low
|
The function 'f' must be defined outside of this routine, and the
|
||||||
and high values are guesses which must produce values with opposite signs.
|
low and high values are guesses which must produce values with
|
||||||
|
opposite signs.
|
||||||
|
|
||||||
|
|
||||||
|
specialfunctions.cal
|
||||||
|
|
||||||
|
beta(a,b)
|
||||||
|
|
||||||
|
Calculates the value of the beta function. See:
|
||||||
|
|
||||||
|
https://en.wikipedia.org/wiki/Beta_function
|
||||||
|
http://mathworld.wolfram.com/BetaFunction.html
|
||||||
|
http://dlmf.nist.gov/5.12
|
||||||
|
|
||||||
|
for information on the beta function.
|
||||||
|
|
||||||
|
|
||||||
|
betainc(a,b,z)
|
||||||
|
|
||||||
|
Calculates the value of the regularized incomplete beta function. See:
|
||||||
|
|
||||||
|
https://en.wikipedia.org/wiki/Beta_function
|
||||||
|
http://mathworld.wolfram.com/RegularizedBetaFunction.html
|
||||||
|
http://dlmf.nist.gov/8.17
|
||||||
|
|
||||||
|
for information on the regularized incomplete beta function.
|
||||||
|
|
||||||
|
|
||||||
|
expoint(z)
|
||||||
|
|
||||||
|
Calculates the value of the exponential integral Ei(z) function at z.
|
||||||
|
See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Exponential_integral
|
||||||
|
http://www.cs.utah.edu/~vpegorar/research/2011_JGT/
|
||||||
|
|
||||||
|
for information on the exponential integral Ei(z) function.
|
||||||
|
|
||||||
|
|
||||||
|
erf(z)
|
||||||
|
|
||||||
|
Calculates the value of the error function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Error_function
|
||||||
|
|
||||||
|
for information on the error function function.
|
||||||
|
|
||||||
|
|
||||||
|
erfc(z)
|
||||||
|
|
||||||
|
Calculates the value of the complementary error function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Error_function
|
||||||
|
|
||||||
|
for information on the complementary error function function.
|
||||||
|
|
||||||
|
|
||||||
|
erfi(z)
|
||||||
|
|
||||||
|
Calculates the value of the imaginary error function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Error_function
|
||||||
|
|
||||||
|
for information on the imaginary error function function.
|
||||||
|
|
||||||
|
|
||||||
|
erfinv(x)
|
||||||
|
|
||||||
|
Calculates the inverse of the error function at x. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Error_function
|
||||||
|
|
||||||
|
for information on the inverse of the error function function.
|
||||||
|
|
||||||
|
|
||||||
|
faddeeva(z)
|
||||||
|
|
||||||
|
Calculates the value of the complex error function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Faddeeva_function
|
||||||
|
|
||||||
|
for information on the complex error function function.
|
||||||
|
|
||||||
|
|
||||||
|
gamma(z)
|
||||||
|
|
||||||
|
Calculates the value of the Euler gamma function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Gamma_function
|
||||||
|
http://dlmf.nist.gov/5
|
||||||
|
|
||||||
|
for information on the Euler gamma function.
|
||||||
|
|
||||||
|
|
||||||
|
gammainc(a,z)
|
||||||
|
|
||||||
|
Calculates the value of the lower incomplete gamma function for
|
||||||
|
arbitrary a, z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Incomplete_gamma_function
|
||||||
|
|
||||||
|
for information on the lower incomplete gamma function.
|
||||||
|
|
||||||
|
gammap(a,z)
|
||||||
|
|
||||||
|
Calculates the value of the regularized lower incomplete gamma
|
||||||
|
function for a, z with a not in -N. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Incomplete_gamma_function
|
||||||
|
|
||||||
|
for information on the regularized lower incomplete gamma function.
|
||||||
|
|
||||||
|
gammaq(a,z)
|
||||||
|
|
||||||
|
Calculates the value of the regularized upper incomplete gamma
|
||||||
|
function for a, z with a not in -N. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Incomplete_gamma_function
|
||||||
|
|
||||||
|
for information on the regularized upper incomplete gamma function.
|
||||||
|
|
||||||
|
|
||||||
|
heavisidestep(x)
|
||||||
|
|
||||||
|
Computes the Heaviside stepp function (1+sign(x))/2
|
||||||
|
|
||||||
|
|
||||||
|
harmonic(limit)
|
||||||
|
|
||||||
|
Calculates partial values of the harmonic series up to limit. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Harmonic_series_(mathematics)
|
||||||
|
http://mathworld.wolfram.com/HarmonicSeries.html
|
||||||
|
|
||||||
|
for information on the harmonic series.
|
||||||
|
|
||||||
|
|
||||||
|
lnbeta(a,b)
|
||||||
|
|
||||||
|
Calculates the natural logarithm of the beta function. See:
|
||||||
|
|
||||||
|
https://en.wikipedia.org/wiki/Beta_function
|
||||||
|
http://mathworld.wolfram.com/BetaFunction.html
|
||||||
|
http://dlmf.nist.gov/5.12
|
||||||
|
|
||||||
|
for information on the beta function.
|
||||||
|
|
||||||
|
lngamma(z)
|
||||||
|
|
||||||
|
Calculates the value of the logarithm of the Euler gamma function
|
||||||
|
at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Gamma_function
|
||||||
|
http://dlmf.nist.gov/5.15
|
||||||
|
|
||||||
|
for information on the derivatives of the the Euler gamma function.
|
||||||
|
|
||||||
|
|
||||||
|
polygamma(m,z)
|
||||||
|
|
||||||
|
Calculates the value of the m-th derivative of the Euler gamma
|
||||||
|
function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Polygamma
|
||||||
|
http://dlmf.nist.gov/5
|
||||||
|
|
||||||
|
for information on the n-th derivative ofthe Euler gamma function. This
|
||||||
|
function depends on the script zeta2.cal.
|
||||||
|
|
||||||
|
|
||||||
|
psi(z)
|
||||||
|
|
||||||
|
Calculates the value of the first derivative of the Euler gamma
|
||||||
|
function at z. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Digamma_function
|
||||||
|
http://dlmf.nist.gov/5
|
||||||
|
|
||||||
|
for information on the first derivative of the Euler gamma function.
|
||||||
|
|
||||||
|
|
||||||
|
zeta(s)
|
||||||
|
|
||||||
|
Calculates the value of the Rieman Zeta function at s. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Riemann_zeta_function
|
||||||
|
http://dlmf.nist.gov/25.2
|
||||||
|
|
||||||
|
for information on the Riemann zeta function. This function depends
|
||||||
|
on the script zeta2.cal.
|
||||||
|
|
||||||
|
|
||||||
|
statistics.cal
|
||||||
|
|
||||||
|
gammaincoctave(z,a)
|
||||||
|
|
||||||
|
Computes the regularized incomplete gamma function in a way to
|
||||||
|
correspond with the function in Octave.
|
||||||
|
|
||||||
|
invbetainc(x,a,b)
|
||||||
|
|
||||||
|
Computes the inverse of the regularized beta function. Does so the
|
||||||
|
brute-force way wich makes it a bit slower.
|
||||||
|
|
||||||
|
betapdf(x,a,b)
|
||||||
|
betacdf(x,a,b)
|
||||||
|
betacdfinv(x,a,b)
|
||||||
|
betamedian(a,b)
|
||||||
|
betamode(a,b)
|
||||||
|
betavariance(a,b)
|
||||||
|
betalnvariance(a,b)
|
||||||
|
betaskewness(a,b)
|
||||||
|
betakurtosis(a,b)
|
||||||
|
betaentropy(a,b)
|
||||||
|
normalpdf(x,mu,sigma)
|
||||||
|
normalcdf(x,mu,sigma)
|
||||||
|
probit(p)
|
||||||
|
normalcdfinv(p,mu,sigma)
|
||||||
|
normalmean(mu,sigma)
|
||||||
|
normalmedian(mu,sigma)
|
||||||
|
normalmode(mu,sigma)
|
||||||
|
normalvariance(mu,sigma)
|
||||||
|
normalskewness(mu,sigma)
|
||||||
|
normalkurtosis(mu,sigma)
|
||||||
|
normalentropy(mu,sigma)
|
||||||
|
normalmgf(mu,sigma,t)
|
||||||
|
normalcf(mu,sigma,t)
|
||||||
|
chisquaredpdf(x,k)
|
||||||
|
chisquaredpcdf(x,k)
|
||||||
|
chisquaredmean(x,k)
|
||||||
|
chisquaredmedian(x,k)
|
||||||
|
chisquaredmode(x,k)
|
||||||
|
chisquaredvariance(x,k)
|
||||||
|
chisquaredskewness(x,k)
|
||||||
|
chisquaredkurtosis(x,k)
|
||||||
|
chisquaredentropy(x,k)
|
||||||
|
chisquaredmfg(k,t)
|
||||||
|
chisquaredcf(k,t)
|
||||||
|
|
||||||
|
Calculates a bunch of (hopefully) aptly named statistical functions.
|
||||||
|
|
||||||
|
|
||||||
|
strings.cal
|
||||||
|
|
||||||
|
toupper(s)
|
||||||
|
tolower(s)
|
||||||
|
strcasecmp(s1,s2)
|
||||||
|
strncasecmp(s1,s2,length)
|
||||||
|
isascii(c)
|
||||||
|
isalnum(c)
|
||||||
|
isalpha(c)
|
||||||
|
iscntrl(c)
|
||||||
|
isdigit(c)
|
||||||
|
isgraph(c)
|
||||||
|
islower(c)
|
||||||
|
isprint(c)
|
||||||
|
ispunct(c)
|
||||||
|
isspace(c)
|
||||||
|
isupper(c)
|
||||||
|
isblank(c)
|
||||||
|
isxdigit(c)
|
||||||
|
|
||||||
|
Implements most of the functions of libc's ctype.h and strings.h.
|
||||||
|
|
||||||
|
|
||||||
sumsq.cal
|
sumsq.cal
|
||||||
@@ -802,7 +1462,8 @@ test1700.cal
|
|||||||
|
|
||||||
value
|
value
|
||||||
|
|
||||||
This resource files is used by regress.cal to test the read and use keywords.
|
This resource files is used by regress.cal to test the read and
|
||||||
|
use keywords.
|
||||||
|
|
||||||
|
|
||||||
test2600.cal
|
test2600.cal
|
||||||
@@ -827,8 +1488,8 @@ test2600.cal
|
|||||||
checkresult(x, y, z, a)
|
checkresult(x, y, z, a)
|
||||||
test2600(verbose, tnum)
|
test2600(verbose, tnum)
|
||||||
|
|
||||||
This resource files is used by regress.cal to test some of builtin functions
|
This resource files is used by regress.cal to test some of builtin
|
||||||
in terms of accuracy and roundoff.
|
functions in terms of accuracy and roundoff.
|
||||||
|
|
||||||
|
|
||||||
test2700.cal
|
test2700.cal
|
||||||
@@ -865,7 +1526,8 @@ test3100.cal
|
|||||||
res_inv(a)
|
res_inv(a)
|
||||||
res(x)
|
res(x)
|
||||||
|
|
||||||
This resource file is used by regress.cal to test determinants of a matrix
|
This resource file is used by regress.cal to test determinants of
|
||||||
|
a matrix.
|
||||||
|
|
||||||
|
|
||||||
test3300.cal
|
test3300.cal
|
||||||
@@ -876,8 +1538,9 @@ test3300.cal
|
|||||||
testr(str, n, N, verbose)
|
testr(str, n, N, verbose)
|
||||||
test3300(verbose, tnum)
|
test3300(verbose, tnum)
|
||||||
|
|
||||||
This resource file is used by regress.cal to provide for more determinant
|
This resource file is used by regress.cal to provide for more
|
||||||
tests.
|
determinant tests.
|
||||||
|
|
||||||
|
|
||||||
test3400.cal
|
test3400.cal
|
||||||
|
|
||||||
@@ -908,6 +1571,7 @@ test3500.cal
|
|||||||
This resource file is used by regress.cal to test the functions frem,
|
This resource file is used by regress.cal to test the functions frem,
|
||||||
fcnt, gcdrem.
|
fcnt, gcdrem.
|
||||||
|
|
||||||
|
|
||||||
test4000.cal
|
test4000.cal
|
||||||
|
|
||||||
global defaultverbose
|
global defaultverbose
|
||||||
@@ -940,6 +1604,7 @@ test4000.cal
|
|||||||
This resource file is used by regress.cal to test ptest, nextcand and
|
This resource file is used by regress.cal to test ptest, nextcand and
|
||||||
prevcand builtins.
|
prevcand builtins.
|
||||||
|
|
||||||
|
|
||||||
test4100.cal
|
test4100.cal
|
||||||
|
|
||||||
global defaultverbose
|
global defaultverbose
|
||||||
@@ -959,6 +1624,7 @@ test4100.cal
|
|||||||
|
|
||||||
This resource file is used by regress.cal to test REDC operations.
|
This resource file is used by regress.cal to test REDC operations.
|
||||||
|
|
||||||
|
|
||||||
test4600.cal
|
test4600.cal
|
||||||
|
|
||||||
stest(str [, verbose]) defined
|
stest(str [, verbose]) defined
|
||||||
@@ -970,6 +1636,7 @@ test4600.cal
|
|||||||
|
|
||||||
This resource file is used by regress.cal to test searching in files.
|
This resource file is used by regress.cal to test searching in files.
|
||||||
|
|
||||||
|
|
||||||
test5100.cal
|
test5100.cal
|
||||||
|
|
||||||
global a5100
|
global a5100
|
||||||
@@ -979,6 +1646,7 @@ test5100.cal
|
|||||||
This resource file is used by regress.cal to test the new code generator
|
This resource file is used by regress.cal to test the new code generator
|
||||||
declaration scope and order.
|
declaration scope and order.
|
||||||
|
|
||||||
|
|
||||||
test5200.cal
|
test5200.cal
|
||||||
|
|
||||||
global a5200
|
global a5200
|
||||||
@@ -990,6 +1658,7 @@ test5200.cal
|
|||||||
This resource file is used by regress.cal to test the fix of a
|
This resource file is used by regress.cal to test the fix of a
|
||||||
global/static bug.
|
global/static bug.
|
||||||
|
|
||||||
|
|
||||||
test8400.cal
|
test8400.cal
|
||||||
|
|
||||||
test8400() defined
|
test8400() defined
|
||||||
@@ -997,6 +1666,7 @@ test8400.cal
|
|||||||
This resource file is used by regress.cal to check for quit-based
|
This resource file is used by regress.cal to check for quit-based
|
||||||
memory leaks.
|
memory leaks.
|
||||||
|
|
||||||
|
|
||||||
test8500.cal
|
test8500.cal
|
||||||
|
|
||||||
global err_8500
|
global err_8500
|
||||||
@@ -1009,6 +1679,7 @@ test8500.cal
|
|||||||
|
|
||||||
This resource file is used by regress.cal to the // and % operators.
|
This resource file is used by regress.cal to the // and % operators.
|
||||||
|
|
||||||
|
|
||||||
test8600.cal
|
test8600.cal
|
||||||
|
|
||||||
global min_8600
|
global min_8600
|
||||||
@@ -1019,6 +1690,25 @@ test8600.cal
|
|||||||
This resource file is used by regress.cal to test a change of
|
This resource file is used by regress.cal to test a change of
|
||||||
allowing up to 1024 args to be passed to a builtin function.
|
allowing up to 1024 args to be passed to a builtin function.
|
||||||
|
|
||||||
|
|
||||||
|
test8900.cal
|
||||||
|
|
||||||
|
This function tests a number of calc resource functions contributed
|
||||||
|
by Christoph Zurnieden. These include:
|
||||||
|
|
||||||
|
bernpoly.cal
|
||||||
|
brentsolve.cal
|
||||||
|
constants.cal
|
||||||
|
factorial2.cal
|
||||||
|
factorial.cal
|
||||||
|
lambertw.cal
|
||||||
|
lnseries.cal
|
||||||
|
specialfunctions.cal
|
||||||
|
statistics.cal
|
||||||
|
toomcook.cal
|
||||||
|
zeta2.cal
|
||||||
|
|
||||||
|
|
||||||
unitfrac.cal
|
unitfrac.cal
|
||||||
|
|
||||||
unitfrac(x)
|
unitfrac(x)
|
||||||
@@ -1026,6 +1716,29 @@ unitfrac.cal
|
|||||||
Represent a fraction as sum of distinct unit fractions.
|
Represent a fraction as sum of distinct unit fractions.
|
||||||
|
|
||||||
|
|
||||||
|
toomcook.cal
|
||||||
|
|
||||||
|
|
||||||
|
toomcook3(a,b)
|
||||||
|
toomcook4(a,b)
|
||||||
|
|
||||||
|
Toom-Cook multiplication algorithm. Multiply two integers a,b by
|
||||||
|
way of the Toom-Cook algorithm. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication
|
||||||
|
|
||||||
|
toomcook3square(a)
|
||||||
|
toomcook4square(a)
|
||||||
|
|
||||||
|
Square the integer a by way of the Toom-Cook algorithm. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication
|
||||||
|
|
||||||
|
The function toomCook4(a,b) calls the function toomCook3(a,b) which
|
||||||
|
calls built-in multiplication at a specific cut-off point. The
|
||||||
|
squaring functions act in the same way.
|
||||||
|
|
||||||
|
|
||||||
varargs.cal
|
varargs.cal
|
||||||
|
|
||||||
sc(a, b, ...)
|
sc(a, b, ...)
|
||||||
@@ -1033,6 +1746,7 @@ varargs.cal
|
|||||||
Example program to use 'varargs'. Program to sum the cubes of all
|
Example program to use 'varargs'. Program to sum the cubes of all
|
||||||
the specified numbers.
|
the specified numbers.
|
||||||
|
|
||||||
|
|
||||||
xx_print.cal
|
xx_print.cal
|
||||||
|
|
||||||
is_octet(a) defined
|
is_octet(a) defined
|
||||||
@@ -1047,6 +1761,19 @@ xx_print.cal
|
|||||||
|
|
||||||
Demo for the xx_print object routines.
|
Demo for the xx_print object routines.
|
||||||
|
|
||||||
|
|
||||||
|
zeta2.cal
|
||||||
|
|
||||||
|
hurwitzzeta(s,a)
|
||||||
|
|
||||||
|
Calculate the value of the Hurwitz Zeta function. See:
|
||||||
|
|
||||||
|
http://en.wikipedia.org/wiki/Hurwitz_zeta_function
|
||||||
|
http://dlmf.nist.gov/25.11
|
||||||
|
|
||||||
|
for information on this special zeta function.
|
||||||
|
|
||||||
|
|
||||||
## Copyright (C) 2000 David I. Bell and Landon Curt Noll
|
## Copyright (C) 2000 David I. Bell and Landon Curt Noll
|
||||||
##
|
##
|
||||||
## Primary author: Landon Curt Noll
|
## Primary author: Landon Curt Noll
|
||||||
@@ -1065,8 +1792,8 @@ xx_print.cal
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.3 $
|
## @(#) $Revision: 30.6 $
|
||||||
## @(#) $Id: README,v 30.3 2011/05/23 22:50:32 chongo Exp $
|
## @(#) $Id: README,v 30.6 2013/08/18 20:01:53 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/cal/RCS/README,v $
|
## @(#) $Source: /usr/local/src/bin/calc/cal/RCS/README,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1990/02/15 01:50:32
|
## Under source code control: 1990/02/15 01:50:32
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: alg_config.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
|
* @(#) $Id: alg_config.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/alg_config.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/alg_config.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2006/06/07 14:10:11
|
* Under source code control: 2006/06/07 14:10:11
|
||||||
@@ -80,7 +80,8 @@ define mul_loop(repeat, x)
|
|||||||
len = sizeof((*x)[0]) / baseb_bytes;
|
len = sizeof((*x)[0]) / baseb_bytes;
|
||||||
for (i=1; i < 4; ++i) {
|
for (i=1; i < 4; ++i) {
|
||||||
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
||||||
quit "mul_loop: 2nd arg matrix elements are not of equal BASEB-bit word length";
|
quit "mul_loop: 2nd arg matrix elements are not of "
|
||||||
|
"equal BASEB-bit word length";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +379,8 @@ define best_mul2()
|
|||||||
}
|
}
|
||||||
} while (ratio >= 1.0);
|
} while (ratio >= 1.0);
|
||||||
if (config("user_debug") > 0) {
|
if (config("user_debug") > 0) {
|
||||||
printf("alg1/alg2 ratio now < 1.0, starting binary search between %d and %d\n",
|
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||||
|
"between %d and %d\n",
|
||||||
low, high);
|
low, high);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +474,8 @@ define sq_loop(repeat, x)
|
|||||||
len = sizeof((*x)[0]) / baseb_bytes;
|
len = sizeof((*x)[0]) / baseb_bytes;
|
||||||
for (i=1; i < 4; ++i) {
|
for (i=1; i < 4; ++i) {
|
||||||
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
||||||
quit "sq_loop: 2nd arg matrix elements are not of equal BASEB-bit word length";
|
quit "sq_loop: 2nd arg matrix elements are not of equal "
|
||||||
|
"BASEB-bit word length";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -769,7 +772,8 @@ define best_sq2()
|
|||||||
}
|
}
|
||||||
} while (ratio >= 1.0);
|
} while (ratio >= 1.0);
|
||||||
if (config("user_debug") > 0) {
|
if (config("user_debug") > 0) {
|
||||||
printf("alg1/alg2 ratio now < 1.0, starting binary search between %d and %d\n",
|
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||||
|
"between %d and %d\n",
|
||||||
low, high);
|
low, high);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -866,7 +870,8 @@ define pow_loop(repeat, x, ex)
|
|||||||
len = sizeof((*x)[0]) / baseb_bytes;
|
len = sizeof((*x)[0]) / baseb_bytes;
|
||||||
for (i=1; i < 4; ++i) {
|
for (i=1; i < 4; ++i) {
|
||||||
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
if ((sizeof((*x)[i]) / baseb_bytes) != len) {
|
||||||
quit "pow_loop: 2nd arg matrix elements are not of equal BASEB-bit word length";
|
quit "pow_loop: 2nd arg matrix elements are not of "
|
||||||
|
"equal BASEB-bit word length";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isint(ex) || ex < 3) {
|
if (!isint(ex) || ex < 3) {
|
||||||
@@ -1151,7 +1156,8 @@ define best_pow2()
|
|||||||
if (config("user_debug") > 1) {
|
if (config("user_debug") > 1) {
|
||||||
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio);
|
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio);
|
||||||
if (ratio > 1.0 && ratio <= 1.02) {
|
if (ratio > 1.0 && ratio <= 1.02) {
|
||||||
printf(" while alg1 is slightly better than alg2, it is not clearly better\n");
|
printf(" while alg1 is slightly better than alg2, "
|
||||||
|
"it is not clearly better\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (ratio <= 1.02);
|
} while (ratio <= 1.02);
|
||||||
@@ -1205,8 +1211,8 @@ define best_pow2()
|
|||||||
looped = 1;
|
looped = 1;
|
||||||
} while (ratio >= 1.0);
|
} while (ratio >= 1.0);
|
||||||
if (config("user_debug") > 0) {
|
if (config("user_debug") > 0) {
|
||||||
printf("alg1/alg2 ratio now < 1.0, starting binary search between %d and %d\n",
|
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||||
low, high);
|
"between %d and %d\n", low, high);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
59
cal/bernpoly.cal
Normal file
59
cal/bernpoly.cal
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* bernpoly - Bernoully polynomials B_n(z) for arbitrary n,z..
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: bernpoly.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bernpoly.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
read -once zeta2
|
||||||
|
|
||||||
|
|
||||||
|
/* Idea by Don Zagier */
|
||||||
|
define bernpoly(n,z){
|
||||||
|
local h s c k;
|
||||||
|
if(isint(n) && n>=0){
|
||||||
|
h=0;s=0;c=-1;
|
||||||
|
for(k=1;k<=n+1;k++){
|
||||||
|
c*=1-(n+2)/k;
|
||||||
|
s+=z^n;
|
||||||
|
z++;
|
||||||
|
h+=c*s/k;
|
||||||
|
}
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
else return -n*hurwitzzeta(1-n,z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "bernpoly(n,z)";
|
||||||
|
}
|
258
cal/brentsolve.cal
Normal file
258
cal/brentsolve.cal
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
/*
|
||||||
|
* brentsolve - Root finding with the Brent-Dekker trick
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: brentsolve.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/brentsolve.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
A short explanation is at http://en.wikipedia.org/wiki/Brent%27s_method
|
||||||
|
I tried to follow the description at wikipedia as much as possible to make
|
||||||
|
the slight changes I did more visible.
|
||||||
|
You may give http://people.sc.fsu.edu/~jburkardt/cpp_src/brent/brent.html a
|
||||||
|
short glimpse (Brent's originl Fortran77 versions and some translations of
|
||||||
|
it).
|
||||||
|
*/
|
||||||
|
|
||||||
|
static true = 1;
|
||||||
|
static false = 0;
|
||||||
|
define brentsolve(low, high,eps){
|
||||||
|
local a b c d fa fb fc fa2 fb2 fc2 s fs tmp tmp2 mflag i places;
|
||||||
|
a = low;
|
||||||
|
b = high;
|
||||||
|
c = 0;
|
||||||
|
|
||||||
|
if(isnull(eps))
|
||||||
|
eps = epsilon(epsilon()*1e-3);
|
||||||
|
places = highbit(1 + int( 1/epsilon() ) ) + 1;
|
||||||
|
|
||||||
|
d = 1/eps;
|
||||||
|
|
||||||
|
fa = f(a);
|
||||||
|
fb = f(b);
|
||||||
|
|
||||||
|
fc = 0;
|
||||||
|
s = 0;
|
||||||
|
fs = 0;
|
||||||
|
|
||||||
|
if(fa * fb >= 0){
|
||||||
|
if(fa < fb){
|
||||||
|
epsilon(eps);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
epsilon(eps);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(abs(fa) < abs(fb)){
|
||||||
|
tmp = a; a = b; b = tmp;
|
||||||
|
tmp = fa; fa = fb; fb = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = a;
|
||||||
|
fc = fa;
|
||||||
|
mflag = 1;
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while(!(fb==0) && (abs(a-b) > eps)){
|
||||||
|
if((fa != fc) && (fb != fc)){
|
||||||
|
/* Inverse quadratic interpolation*/
|
||||||
|
fc2 = fc^2;
|
||||||
|
fa2 = fa^2;
|
||||||
|
s = bround(((fb^2*((fc*a)-(c*fa)))+(fb*((c*fa2)-(fc2*a)))+(b*((fc2*fa)
|
||||||
|
-(fc*fa2))))/((fc - fb)*(fa - fb)*(fc - fa)),places++);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
/* Secant Rule*/
|
||||||
|
s =bround( b - fb * (b - a) / (fb - fa),places++);
|
||||||
|
}
|
||||||
|
tmp2 = (3 * a + b) / 4;
|
||||||
|
if( (!( ((s > tmp2) && (s < b))||((s < tmp2) && (s > b))))
|
||||||
|
|| (mflag && (abs(s - b) >= (abs(b - c) / 2)))
|
||||||
|
|| (!mflag && (abs(s - b) >= (abs(c - d) / 2)))) {
|
||||||
|
s = (a + b) / 2;
|
||||||
|
mflag = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if( (mflag && (abs(b - c) < eps))
|
||||||
|
|| (!mflag && (abs(c - d) < eps))) {
|
||||||
|
s = (a + b) / 2;
|
||||||
|
mflag = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mflag = false;
|
||||||
|
}
|
||||||
|
fs = f(s);
|
||||||
|
c = b;
|
||||||
|
fc = fb;
|
||||||
|
if (fa * fs < 0){
|
||||||
|
b = s;
|
||||||
|
fb = fs;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
a = s;
|
||||||
|
fa = fs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (abs(fa) < abs(fb)){
|
||||||
|
tmp = a; a = b; b = tmp;
|
||||||
|
tmp = fa; fa = fb; fb = tmp;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (i > 1000){
|
||||||
|
epsilon(eps);
|
||||||
|
return newerror("brentsolve: does not converge");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epsilon(eps);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
A variation of the solver to accept functions named differently from "f". The
|
||||||
|
code should explain it.
|
||||||
|
*/
|
||||||
|
define brentsolve2(low, high,which,eps){
|
||||||
|
local a b c d fa fb fc fa2 fb2 fc2 s fs tmp tmp2 mflag i places;
|
||||||
|
a = low;
|
||||||
|
b = high;
|
||||||
|
c = 0;
|
||||||
|
|
||||||
|
switch(param(0)){
|
||||||
|
case 0:
|
||||||
|
case 1: return newerror("brentsolve2: not enough argments");
|
||||||
|
case 2: eps = epsilon(epsilon()*1e-2);
|
||||||
|
which = 0;break;
|
||||||
|
case 3: eps = epsilon(epsilon()*1e-2);break;
|
||||||
|
default: break;
|
||||||
|
};
|
||||||
|
places = highbit(1 + int(1/epsilon())) + 1;
|
||||||
|
|
||||||
|
d = 1/eps;
|
||||||
|
|
||||||
|
switch(which){
|
||||||
|
case 1: fa = __CZ__invbeta(a);
|
||||||
|
fb = __CZ__invbeta(b); break;
|
||||||
|
case 2: fa = __CZ__invincgamma(a);
|
||||||
|
fb = __CZ__invincgamma(b); break;
|
||||||
|
|
||||||
|
default: fa = f(a);fb = f(b); break;
|
||||||
|
};
|
||||||
|
|
||||||
|
fc = 0;
|
||||||
|
s = 0;
|
||||||
|
fs = 0;
|
||||||
|
|
||||||
|
if(fa * fb >= 0){
|
||||||
|
if(fa < fb)
|
||||||
|
return a;
|
||||||
|
else
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(abs(fa) < abs(fb)){
|
||||||
|
tmp = a; a = b; b = tmp;
|
||||||
|
tmp = fa; fa = fb; fb = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = a;
|
||||||
|
fc = fa;
|
||||||
|
mflag = 1;
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while(!(fb==0) && (abs(a-b) > eps)){
|
||||||
|
|
||||||
|
if((fa != fc) && (fb != fc)){
|
||||||
|
/* Inverse quadratic interpolation*/
|
||||||
|
fc2 = fc^2;
|
||||||
|
fa2 = fa^2;
|
||||||
|
s = bround(((fb^2*((fc*a)-(c*fa)))+(fb*((c*fa2)-(fc2*a)))+(b*((fc2*fa)
|
||||||
|
-(fc*fa2))))/((fc - fb)*(fa - fb)*(fc - fa)),places);
|
||||||
|
places++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
/* Secant Rule*/
|
||||||
|
s =bround( b - fb * (b - a) / (fb - fa),places);
|
||||||
|
places++;
|
||||||
|
}
|
||||||
|
tmp2 = (3 * a + b) / 4;
|
||||||
|
if( (!( ((s > tmp2) && (s < b))||((s < tmp2) && (s > b))))
|
||||||
|
|| (mflag && (abs(s - b) >= (abs(b - c) / 2)))
|
||||||
|
|| (!mflag && (abs(s - b) >= (abs(c - d) / 2)))) {
|
||||||
|
s = (a + b) / 2;
|
||||||
|
mflag = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if( (mflag && (abs(b - c) < eps))
|
||||||
|
|| (!mflag && (abs(c - d) < eps))) {
|
||||||
|
s = (a + b) / 2;
|
||||||
|
mflag = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mflag = false;
|
||||||
|
}
|
||||||
|
switch(which){
|
||||||
|
case 1: fs = __CZ__invbeta(s); break;
|
||||||
|
case 2: fs = __CZ__invincgamma(s); break;
|
||||||
|
|
||||||
|
default: fs = f(s); break;
|
||||||
|
};
|
||||||
|
c = b;
|
||||||
|
fc = fb;
|
||||||
|
if (fa * fs < 0){
|
||||||
|
b = s;
|
||||||
|
fb = fs;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
a = s;
|
||||||
|
fa = fs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (abs(fa) < abs(fb)){
|
||||||
|
tmp = a; a = b; b = tmp;
|
||||||
|
tmp = fa; fa = fb; fb = tmp;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (i > 1000){
|
||||||
|
return newerror("brentsolve2: does not converge");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "brentsolve(low, high,eps)";
|
||||||
|
print "brentsolve2(low, high,which,eps)";
|
||||||
|
}
|
104
cal/constants.cal
Normal file
104
cal/constants.cal
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* constants - implementation of different constants to arbitrary precision
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: constants.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/constants.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
static __CZ__euler_mascheroni = 0;
|
||||||
|
static __CZ__euler_mascheroni_prec = 0;
|
||||||
|
|
||||||
|
|
||||||
|
define e(){
|
||||||
|
local k temp1 temp2 ret eps factor upperlimit prec;
|
||||||
|
|
||||||
|
prec = digits(1/epsilon());
|
||||||
|
if(__CZ__euler_mascheroni != 0 && __CZ__euler_mascheroni_prec >= prec)
|
||||||
|
return __CZ__euler_mascheroni;
|
||||||
|
if(prec<=20) return 2.718281828459045235360287471;
|
||||||
|
if(prec<=1800){
|
||||||
|
__CZ__euler_mascheroni = exp(1);
|
||||||
|
__CZ__euler_mascheroni_prec = prec;
|
||||||
|
}
|
||||||
|
|
||||||
|
eps=epsilon(1e-20);
|
||||||
|
factor = 1;
|
||||||
|
k = 0;
|
||||||
|
upperlimit = prec * ln(10);
|
||||||
|
while(k<upperlimit){
|
||||||
|
k += ln(factor);
|
||||||
|
factor++;
|
||||||
|
}
|
||||||
|
epsilon(eps);
|
||||||
|
temp1 = 0;
|
||||||
|
ret = 1;
|
||||||
|
for(k=3;k<=factor;k++){
|
||||||
|
temp2 = temp1;
|
||||||
|
temp1 = ret;
|
||||||
|
ret = (k-1) *(temp1 + temp2);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = inverse( ret * inverse(factorial(factor) ) ) ;
|
||||||
|
__CZ__euler_mascheroni = ret;
|
||||||
|
__CZ__euler_mascheroni_prec = prec;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Lupas' series */
|
||||||
|
static __CZ__catalan = 0;
|
||||||
|
static __CZ__catalan_prec = 0;
|
||||||
|
define G(){
|
||||||
|
local eps a s t n;
|
||||||
|
eps = epsilon(epsilon()*1e-10);
|
||||||
|
if(__CZ__catalan != 0 && __CZ__catalan >= log(1/eps))
|
||||||
|
return __CZ__catalan;
|
||||||
|
a = 1;
|
||||||
|
s = 0;
|
||||||
|
t = 1;
|
||||||
|
n = 1;
|
||||||
|
while(abs(t)> eps){
|
||||||
|
a *= 32 * n^3 * (2*n-1);
|
||||||
|
a /=((3-16*n+16*n^2)^2);
|
||||||
|
t = a * (-1)^(n-1) * (40*n^2-24*n+3) / (n^3 * (2*n-1));
|
||||||
|
s += t;
|
||||||
|
n += 1;
|
||||||
|
}
|
||||||
|
s = s/64;
|
||||||
|
__CZ__catalan = s;
|
||||||
|
__CZ__catalan_prec = log(1/eps);
|
||||||
|
epsilon(eps);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "e()";
|
||||||
|
print "G()";
|
||||||
|
}
|
204
cal/factorial.cal
Normal file
204
cal/factorial.cal
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
/*
|
||||||
|
* factorial - implementation of different algorithms for the factorial
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: factorial.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hide internal function from resource debugging
|
||||||
|
*/
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
get dependencies
|
||||||
|
*/
|
||||||
|
read -once toomcook;
|
||||||
|
|
||||||
|
|
||||||
|
/* A simple list to keep things...uhm...simple?*/
|
||||||
|
static __CZ__primelist = list();
|
||||||
|
|
||||||
|
/* Helper for primorial: fill list with primes in range a,b */
|
||||||
|
define __CZ__fill_prime_list(a,b)
|
||||||
|
{
|
||||||
|
local k;
|
||||||
|
k=a;
|
||||||
|
if(isprime(k))k--;
|
||||||
|
while(1){
|
||||||
|
k = nextprime(k);
|
||||||
|
if(k > b) break;
|
||||||
|
append(__CZ__primelist,k );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Helper for factorial: how often prime p divides the factorial of n */
|
||||||
|
define __CZ__prime_divisors(n,p)
|
||||||
|
{
|
||||||
|
local q,m;
|
||||||
|
q = n;
|
||||||
|
m = 0;
|
||||||
|
if (p > n) return 0;
|
||||||
|
if (p > n/2) return 1;
|
||||||
|
while (q >= p) {
|
||||||
|
q = q//p;
|
||||||
|
m += q;
|
||||||
|
}
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Wrapper. Please set cut-offs to own taste and hardware.
|
||||||
|
*/
|
||||||
|
define factorial(n){
|
||||||
|
local prime result shift prime_list k k1 k2 expo_list pix cut primorial;
|
||||||
|
|
||||||
|
result = 1;
|
||||||
|
prime = 2;
|
||||||
|
|
||||||
|
if(!isint(n)) {
|
||||||
|
return newerror("factorial(n): n is not an integer"); ## or gamma(n)?
|
||||||
|
}
|
||||||
|
if(n < 0) return newerror("factorial(n): n < 0");
|
||||||
|
if(n < 9000 && !isdefined("test8900")) {
|
||||||
|
## builtin is implemented with splitting but only with
|
||||||
|
## Toom-Cook 2 (by Karatsuba (the father))
|
||||||
|
return n!;
|
||||||
|
}
|
||||||
|
|
||||||
|
shift = __CZ__prime_divisors(n,prime);
|
||||||
|
prime = 3;
|
||||||
|
cut = n//2;
|
||||||
|
pix = pix(cut);
|
||||||
|
prime_list = mat[pix];
|
||||||
|
expo_list = mat[pix];
|
||||||
|
|
||||||
|
k = 0;
|
||||||
|
/*
|
||||||
|
Peter Borwein's algorithm
|
||||||
|
|
||||||
|
@Article{journals/jal/Borwein85,
|
||||||
|
author = {Borwein, Peter B.},
|
||||||
|
title = {On the Complexity of Calculating Factorials.},
|
||||||
|
journal = {J. Algorithms},
|
||||||
|
year = {1985},
|
||||||
|
number = {3},
|
||||||
|
url = {http://dblp.uni-trier.de/db/journals/jal/jal6.html#Borwein85}
|
||||||
|
*/
|
||||||
|
|
||||||
|
do {
|
||||||
|
prime_list[k] = prime;
|
||||||
|
expo_list[k++] = __CZ__prime_divisors(n,prime);
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= cut);
|
||||||
|
|
||||||
|
/* size of the largest exponent in bits */
|
||||||
|
k1 = highbit(expo_list[0]);
|
||||||
|
k2 = size(prime_list)-1;
|
||||||
|
|
||||||
|
for(;k1>=0;k1--){
|
||||||
|
/*
|
||||||
|
the cut-off for T-C-4 ist still to low, using T-C-3 here
|
||||||
|
TODO: check cutoffs
|
||||||
|
*/
|
||||||
|
result = toomcook3square(result);
|
||||||
|
/*
|
||||||
|
almost all time is spend in this loop, so cutting of the
|
||||||
|
upper half of the primes makes sense
|
||||||
|
*/
|
||||||
|
for(k=0; k<=k2; k++) {
|
||||||
|
if((expo_list[k] & (1 << k1)) != 0) {
|
||||||
|
result *= prime_list[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
primorial = primorial( cut, n);
|
||||||
|
result *= primorial;
|
||||||
|
result <<= shift;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Helper for primorial: do the product with binary splitting
|
||||||
|
TODO: do it without the intermediate list
|
||||||
|
*/
|
||||||
|
define __CZ__primorial__lowlevel( a, b ,p)
|
||||||
|
{
|
||||||
|
local c;
|
||||||
|
if( b == a) return p ;
|
||||||
|
if( b-a > 1){
|
||||||
|
c= (b + a) >> 1;
|
||||||
|
return __CZ__primorial__lowlevel( a , c , __CZ__primelist[a] )
|
||||||
|
* __CZ__primorial__lowlevel( c+1 , b , __CZ__primelist[b] ) ;
|
||||||
|
}
|
||||||
|
return __CZ__primelist[a] * __CZ__primelist[b];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Primorial, Product of consecutive primes in range a,b
|
||||||
|
|
||||||
|
Originally meant to do primorials with a start different from 2, but
|
||||||
|
found out that this is faster at about a=1,b>=10^5 than the builtin
|
||||||
|
function pfact(). With the moderately small list a=1,b=10^6 (78498
|
||||||
|
primes) it is 3 times faster. A quick look-up showed what was already
|
||||||
|
guessed: pfact() does it linearly. (BTW: what is the time complexity
|
||||||
|
of the primorial with the naive algorithm?)
|
||||||
|
*/
|
||||||
|
define primorial(a,b)
|
||||||
|
{
|
||||||
|
local C1 C2;
|
||||||
|
if(!isint(a)) return newerror("primorial(a,b): a is not an integer");
|
||||||
|
else if(!isint(b)) return newerror("primorial(a,b): b is not an integer");
|
||||||
|
else if(a < 0) return newerror("primorial(a,b): a < 0");
|
||||||
|
else if( b < 2 ) return newerror("primorial(a,b): b < 2");
|
||||||
|
else if( b < a) return newerror("primorial(a,b): b < a");
|
||||||
|
else{
|
||||||
|
/* last prime < 2^32 is also max. prime for nextprime()*/
|
||||||
|
if(b >= 4294967291) return newerror("primorial(a,b): max. prime exceeded");
|
||||||
|
if(b == 2) return 2;
|
||||||
|
/*
|
||||||
|
Can be extended by way of pfact(b)/pfact(floor(a-1/2)) for small a
|
||||||
|
*/
|
||||||
|
if(a<=2 && b < 10^5) return pfact(b);
|
||||||
|
/* TODO: use pix() and a simple array (mat[])instead*/
|
||||||
|
__CZ__primelist = list();
|
||||||
|
__CZ__fill_prime_list(a,b);
|
||||||
|
C1 = size(__CZ__primelist)-1;
|
||||||
|
return __CZ__primorial__lowlevel( 0, C1,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
* report important interface functions
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "factorial(n)";
|
||||||
|
print "primorial(a, b)";
|
||||||
|
}
|
723
cal/factorial2.cal
Normal file
723
cal/factorial2.cal
Normal file
@@ -0,0 +1,723 @@
|
|||||||
|
/*
|
||||||
|
* factorial2 - implementation of different factorial related functions
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: factorial2.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial2.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hide internal function from resource debugging
|
||||||
|
*/
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
get dependencies
|
||||||
|
*/
|
||||||
|
read -once factorial toomcook specialfunctions;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Factorize a factorial and put the result in a 2-column matrix with pi(n) rows
|
||||||
|
mat[ primes , exponent ]
|
||||||
|
Result can be restricted to start at a prime different from 2 with the second
|
||||||
|
argument "start". That arguments gets taken at face value if it prime and
|
||||||
|
smaller than n, otherwise the next larger prime is taken if that prime is
|
||||||
|
smaller than n.
|
||||||
|
*/
|
||||||
|
|
||||||
|
define __CZ__factor_factorial(n,start){
|
||||||
|
local prime prime_list k pix stop;
|
||||||
|
|
||||||
|
|
||||||
|
if(!isint(n)) return
|
||||||
|
newerror("__CZ__factor_factorial(n,start): n is not integer");
|
||||||
|
if(n < 0) return newerror("__CZ__factor_factorial(n,start): n < 0");
|
||||||
|
if(n == 1) return newerror("__CZ__factor_factorial(n,start): n == 1");
|
||||||
|
|
||||||
|
if(start){
|
||||||
|
if(!isint(start) && start < 0 && start > n)
|
||||||
|
return newerror("__CZ__factor_factorial(n,start): value of "
|
||||||
|
"parameter 'start' out of range");
|
||||||
|
if(start == n && isprime(n)){
|
||||||
|
prime_list = mat[1 , 2];
|
||||||
|
prime_list[0,0] = n;
|
||||||
|
prime_list[0,1] = 1;
|
||||||
|
}
|
||||||
|
else if(!isprime(start) && nextprime(start) >n)
|
||||||
|
return newerror("__CZ__factor_factorial(n,start): value of parameter "
|
||||||
|
"'start' out of range");
|
||||||
|
else{
|
||||||
|
if(!isprime(start)) prime = nextprime(start);
|
||||||
|
else prime = start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
prime = 2;
|
||||||
|
|
||||||
|
pix = pix(n);
|
||||||
|
if(start){
|
||||||
|
pix -= pix(prime) -1;
|
||||||
|
}
|
||||||
|
prime_list = mat[pix , 2];
|
||||||
|
|
||||||
|
k = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
prime_list[k ,0] = prime;
|
||||||
|
prime_list[k++,1] = __CZ__prime_divisors(n,prime);
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= n);
|
||||||
|
|
||||||
|
return prime_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
subtracts exponents of n_1! from exponents of n_2! with n_1<=n_2
|
||||||
|
|
||||||
|
Does not check for size or consecutiveness of the primes or a carry
|
||||||
|
*/
|
||||||
|
|
||||||
|
define __CZ__subtract_factored_factorials(matrix_2n,matrix_n){
|
||||||
|
local k ret len1,len2,tmp count p e;
|
||||||
|
len1 = size(matrix_n)/2;
|
||||||
|
len2 = size(matrix_2n)/2;
|
||||||
|
if(len2<len1){
|
||||||
|
|
||||||
|
swap(len1,len2);
|
||||||
|
tmp = matrix_n;
|
||||||
|
matrix_n = matrix_2n;
|
||||||
|
matrix_2n = tmp;
|
||||||
|
}
|
||||||
|
tmp = mat[len1,2];
|
||||||
|
k = 0;
|
||||||
|
|
||||||
|
for(;k<len1;k++){
|
||||||
|
p = matrix_2n[k,0];
|
||||||
|
e = matrix_2n[k,1] - matrix_n[k,1];
|
||||||
|
if(e!=0){
|
||||||
|
tmp[count ,0] = p;
|
||||||
|
tmp[count++,1] = e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = mat[count + (len2-len1),2];
|
||||||
|
for(k=0;k<count;k++){
|
||||||
|
ret[k,0] = tmp[k,0];
|
||||||
|
ret[k,1] = tmp[k,1];
|
||||||
|
}
|
||||||
|
|
||||||
|
free(tmp);
|
||||||
|
for(k=len1;k<len2;k++){
|
||||||
|
ret[count,0] = matrix_2n[k,0];
|
||||||
|
ret[count++,1] = matrix_2n[k,1];
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
adds exponents of n_1! to exponents of n_2! with n_1<=n_2
|
||||||
|
|
||||||
|
Does not check for size or consecutiveness of the primes or a carry
|
||||||
|
*/
|
||||||
|
|
||||||
|
define __CZ__add_factored_factorials(matrix_2n,matrix_n){
|
||||||
|
local k ret len1,len2,tmp;
|
||||||
|
len1 = size(matrix_n)/2;
|
||||||
|
len2 = size(matrix_2n)/2;
|
||||||
|
if(len2<len1){
|
||||||
|
swap(len1,len2);
|
||||||
|
tmp = matrix_n;
|
||||||
|
matrix_n = matrix_2n;
|
||||||
|
matrix_2n = tmp;
|
||||||
|
}
|
||||||
|
ret = mat[len2,2];
|
||||||
|
k = 0;
|
||||||
|
for(;k<len1;k++){
|
||||||
|
ret[k,0] = matrix_2n[k,0];
|
||||||
|
ret[k,1] = matrix_2n[k,1] + matrix_n[k,1];
|
||||||
|
}
|
||||||
|
for(;k<len2;k++){
|
||||||
|
ret[k,0] = matrix_2n[k,0];
|
||||||
|
ret[k,1] = matrix_2n[k,1];
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Does not check if all exponents are positive
|
||||||
|
|
||||||
|
|
||||||
|
timings
|
||||||
|
this comb comb-this rel. k/n
|
||||||
|
; benchmark_binomial(10,13)
|
||||||
|
n=2^13 k=2^10 0.064004 0.016001 + 0.76923076923076923077
|
||||||
|
n=2^13 k=2^11 0.064004 0.048003 + 0.84615384615384615385
|
||||||
|
n=2^13 k=2^12 0.068004 0.124008 - 0.92307692307692307692
|
||||||
|
; benchmark_binomial(10,15)
|
||||||
|
n=2^15 k=2^10 0.216014 0.024001 + 0.66666666666666666667
|
||||||
|
n=2^15 k=2^11 0.220014 0.064004 + 0.73333333333333333333
|
||||||
|
n=2^15 k=2^12 0.228014 0.212014 + 0.8
|
||||||
|
n=2^15 k=2^13 0.216013 0.664042 - 0.86666666666666666667
|
||||||
|
n=2^15 k=2^14 0.240015 1.868117 - 0.93333333333333333333
|
||||||
|
; benchmark_binomial(11,15)
|
||||||
|
n=2^15 k=2^11 0.216014 0.068004 + 0.73333333333333333333
|
||||||
|
n=2^15 k=2^12 0.236015 0.212013 + 0.8
|
||||||
|
n=2^15 k=2^13 0.216013 0.656041 - 0.86666666666666666667
|
||||||
|
n=2^15 k=2^14 0.244016 1.872117 - 0.93333333333333333333
|
||||||
|
; benchmark_binomial(11,18)
|
||||||
|
n=2^18 k=2^11 1.652103 0.100006 + 0.61111111111111111111
|
||||||
|
n=2^18 k=2^12 1.608101 0.336021 + 0.66666666666666666667
|
||||||
|
n=2^18 k=2^13 1.700106 1.140071 + 0.72222222222222222222
|
||||||
|
n=2^18 k=2^14 1.756109 3.924245 - 0.77777777777777777778
|
||||||
|
n=2^18 k=2^15 2.036127 13.156822 - 0.83333333333333333333
|
||||||
|
n=2^18 k=2^16 2.172135 41.974624 - 0.88888888888888888889
|
||||||
|
n=2^18 k=2^17 2.528158 121.523594 - 0.94444444444444444444
|
||||||
|
; benchmark_binomial(15,25)
|
||||||
|
n=2^25 k=2^15 303.790985 38.266392 + 0.6
|
||||||
|
; benchmark_binomial(17,25)
|
||||||
|
n=2^25 k=2^17 319.127944 529.025062 - 0.68
|
||||||
|
*/
|
||||||
|
|
||||||
|
define benchmark_binomial(s,limit){
|
||||||
|
local ret k A B T1 T2 start end N K;
|
||||||
|
N = 2^(limit);
|
||||||
|
for(k=s;k<limit;k++){
|
||||||
|
K = 2^k;
|
||||||
|
start=usertime();A=binomial(N,K);end=usertime();
|
||||||
|
T1 = end-start;
|
||||||
|
start=usertime();B=comb(N,K);end=usertime();
|
||||||
|
T2 = end-start;
|
||||||
|
print "n=2^"limit,"k=2^"k," ",T1," ",T2,T1<T2?"-":"+"," "k/limit;
|
||||||
|
if(A!=B){
|
||||||
|
print "false";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
define __CZ__multiply_factored_factorial(matrix,stop){
|
||||||
|
local prime result shift prime_list k k1 k2 expo_list pix count start;
|
||||||
|
local hb flag;
|
||||||
|
|
||||||
|
result = 1;
|
||||||
|
shift = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if(!ismat(matrix))
|
||||||
|
return newerror("__CZ__multiply_factored_factorial(matrix): "
|
||||||
|
"argument matrix not a matrix ");
|
||||||
|
if(!matrix[0,0])
|
||||||
|
return
|
||||||
|
newerror("__CZ__multiply_factored_factorial(matrix): "
|
||||||
|
"matrix[0,0] is null/0");
|
||||||
|
|
||||||
|
if(!isnull(stop))
|
||||||
|
pix = stop;
|
||||||
|
else
|
||||||
|
pix = size(matrix)/2-1;
|
||||||
|
|
||||||
|
if(matrix[0,0] == 2 && matrix[0,1] > 0){
|
||||||
|
shift = matrix[0,1];
|
||||||
|
if(pix-1 == 0)
|
||||||
|
return 2^matrix[0,1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
This is a more general way to do the multiplication, so any optimization
|
||||||
|
must have been done by the caller.
|
||||||
|
*/
|
||||||
|
k = 0;
|
||||||
|
/*
|
||||||
|
The size of the largest exponent in bits is calculated dynamically.
|
||||||
|
Can be done more elegantly and saves one run over the whole array if done
|
||||||
|
inside the main loop.
|
||||||
|
*/
|
||||||
|
hb =0;
|
||||||
|
for(k=0;k<pix;k++){
|
||||||
|
k1=highbit(matrix[k,1]);
|
||||||
|
if(hb < k1)hb=k1;
|
||||||
|
}
|
||||||
|
|
||||||
|
k2 = pix;
|
||||||
|
start = 0;
|
||||||
|
if(shift) start++;
|
||||||
|
|
||||||
|
for(k1=hb;k1>=0;k1--){
|
||||||
|
/*
|
||||||
|
the cut-off for T-C-4 ist still too low, using T-C-3 here
|
||||||
|
TODO: check cutoffs
|
||||||
|
*/
|
||||||
|
result = toomcook3square(result);
|
||||||
|
|
||||||
|
for(k=start; k<=k2; k++) {
|
||||||
|
if((matrix[k,1] & (1 << k1)) != 0) {
|
||||||
|
result *= matrix[k,0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result <<= shift;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Compute binomial coeficients n!/(k!(n-k)!)
|
||||||
|
|
||||||
|
One of the rare cases where a formula once meant to ease manual computation
|
||||||
|
is actually the (aymptotically) fastest way to do it (in July 2013) for
|
||||||
|
the extreme case binomial(2N,N) but for a high price, the memory
|
||||||
|
needed is pi(N)--theoretically.
|
||||||
|
*/
|
||||||
|
define binomial(n,k){
|
||||||
|
local ret factored_n factored_k factored_nk denom num quot K prime_list prime;
|
||||||
|
local pix diff;
|
||||||
|
|
||||||
|
if(!isint(n) || !isint(k))
|
||||||
|
return newerror("binomial(n,k): input is not integer");
|
||||||
|
if(n<0 || k<0)
|
||||||
|
return newerror("binomial(n,k): input is not >= 0"); ;
|
||||||
|
if(n<k ) return 0;
|
||||||
|
if(n==k) return 1;
|
||||||
|
if(k==0) return 1;
|
||||||
|
if(k==1) return n;
|
||||||
|
if(n-k==1) return n;
|
||||||
|
/*
|
||||||
|
cut-off depends on real size of n,k and size of n/k
|
||||||
|
The current cut-off is to small for large n, e.g.:
|
||||||
|
for 2n=2^23, k=n-n/2 the quotient is q=2n/k=0.25. Empirical tests showed
|
||||||
|
that 2n=2^23 and k=2^16 with q=0.0078125 are still faster than the
|
||||||
|
builtin function.
|
||||||
|
|
||||||
|
The symmetry (n,k) = (n,n-k) is of not much advantage here. One way
|
||||||
|
might be to get closer to k=n/2 if k<n-k but only if the difference
|
||||||
|
is small and n very large.
|
||||||
|
*/
|
||||||
|
if(n<2e4 && !isdefined("test8900")) return comb(n,k);
|
||||||
|
if(n<2e4 && k< n-n/2 && !isdefined("test8900")) return comb(n,k);
|
||||||
|
/*
|
||||||
|
This should be done in parallel to save some memory, e.g. no temporary
|
||||||
|
arrays are needed, all can be done inline.
|
||||||
|
The theoretical memory needed is pi(k).
|
||||||
|
Which is still a lot.
|
||||||
|
*/
|
||||||
|
|
||||||
|
prime = 2;
|
||||||
|
pix = pix(n);
|
||||||
|
prime_list = mat[pix , 2];
|
||||||
|
K = 0;
|
||||||
|
do {
|
||||||
|
prime_list[K ,0] = prime;
|
||||||
|
diff = __CZ__prime_divisors(n,prime)-
|
||||||
|
( __CZ__prime_divisors(n-k,prime)+__CZ__prime_divisors(k,prime));
|
||||||
|
if(diff != 0)
|
||||||
|
prime_list[K++,1] = diff;
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= k);
|
||||||
|
|
||||||
|
do {
|
||||||
|
prime_list[K ,0] = prime;
|
||||||
|
diff = __CZ__prime_divisors(n,prime)-__CZ__prime_divisors(n-k,prime);
|
||||||
|
if(diff != 0)
|
||||||
|
prime_list[K++,1] = diff;
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= n-k);
|
||||||
|
|
||||||
|
do {
|
||||||
|
prime_list[K ,0] = prime;
|
||||||
|
prime_list[K++,1] = __CZ__prime_divisors(n,prime);
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= n);
|
||||||
|
##print K,pix(k),pix(n-k),pix(n);
|
||||||
|
##factored_k = __CZ__factor_factorial(k,1);
|
||||||
|
##factored_nk = __CZ__factor_factorial(n-k,1);
|
||||||
|
|
||||||
|
##denom = __CZ__add_factored_factorials(factored_k,factored_nk);
|
||||||
|
##free(factored_k,factored_nk);
|
||||||
|
##num = __CZ__factor_factorial(n,1);
|
||||||
|
##quot = __CZ__subtract_factored_factorials( num , denom );
|
||||||
|
##free(num,denom);
|
||||||
|
|
||||||
|
ret = __CZ__multiply_factored_factorial(`prime_list,K-1);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Compute large catalan numbers C(n) = binomial(2n,n)/(n+1) with
|
||||||
|
cut-off: (n>5e4)
|
||||||
|
Needs a lot of memory.
|
||||||
|
*/
|
||||||
|
define bigcatalan(n){
|
||||||
|
if(!isint(n) )return newerror("bigcatalan(n): n is not integer");
|
||||||
|
if( n<0) return newerror("bigcatalan(n): n < 0");
|
||||||
|
if( n<5e4 && !isdefined("test8900") ) return catalan(n);
|
||||||
|
return binomial(2*n,n)/(n+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
df(-111) = -1/3472059605858239446587523014902616804783337112829102414124928
|
||||||
|
7753332469144201839599609375
|
||||||
|
|
||||||
|
df(-3+1i) = 0.12532538977287649201-0.0502372106177184607i
|
||||||
|
df(2n + 1) = (2*n)!/(n!*2^n)
|
||||||
|
*/
|
||||||
|
define __CZ__double_factorial(n){
|
||||||
|
local n1 n2 diff prime pix K prime_list k;
|
||||||
|
prime = 3;
|
||||||
|
pix = pix(2*n)+1;
|
||||||
|
prime_list = mat[pix , 2];
|
||||||
|
K = 0;
|
||||||
|
do {
|
||||||
|
prime_list[K ,0] = prime;
|
||||||
|
diff = __CZ__prime_divisors(2*n,prime)-( __CZ__prime_divisors(n,prime));
|
||||||
|
if(diff != 0)
|
||||||
|
prime_list[K++,1] = diff;
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= n);
|
||||||
|
do {
|
||||||
|
prime_list[K ,0] = prime;
|
||||||
|
prime_list[K++,1] = __CZ__prime_divisors(2*n,prime);
|
||||||
|
prime = nextprime(prime);
|
||||||
|
}while(prime <= 2*n);
|
||||||
|
return __CZ__multiply_factored_factorial(prime_list,K);
|
||||||
|
/*
|
||||||
|
n1=__CZ__factor_factorial(2*n,1);
|
||||||
|
n1[0,1] = n1[0,1]-n;
|
||||||
|
n2=__CZ__factor_factorial(n,1);
|
||||||
|
diff=__CZ__subtract_factored_factorials( n1 , n2 );
|
||||||
|
return __CZ__multiply_factored_factorial(diff);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
##1, 1, 3, 15, 105, 945, 10395, 135135, 2027025, 34459425, 654729075,
|
||||||
|
##13749310575, 316234143225, 7905853580625, 213458046676875,
|
||||||
|
##6190283353629375, 191898783962510625, 6332659870762850625,
|
||||||
|
##221643095476699771875, 8200794532637891559375
|
||||||
|
|
||||||
|
## 1, 2, 8, 48, 384, 3840, 46080, 645120, 10321920, 185794560,
|
||||||
|
##3715891200, 81749606400, 1961990553600, 51011754393600,
|
||||||
|
##1428329123020800, 42849873690624000, 1371195958099968000,
|
||||||
|
##46620662575398912000, 1678343852714360832000, 63777066403145711616000
|
||||||
|
define doublefactorial(n){
|
||||||
|
local n1 n2 diff eps ret;
|
||||||
|
if(!isint(n) ){
|
||||||
|
/*
|
||||||
|
Probably one of the not-so-good ideas. See result of
|
||||||
|
http://www.wolframalpha.com/input/?i=doublefactorial%28a%2Bbi%29
|
||||||
|
*/
|
||||||
|
eps=epsilon(epsilon()*1e-2);
|
||||||
|
ret = 2^(n/2-1/4 * cos(pi()* n)+1/4) * pi()^(1/4 *
|
||||||
|
cos(pi()* n)-1/4)* gamma(n/2+1);
|
||||||
|
epsilon(eps);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
if(n==2) return 2;
|
||||||
|
if(n==3) return 3;
|
||||||
|
switch(n){
|
||||||
|
case -1:
|
||||||
|
case 0 : return 1;break;
|
||||||
|
case 2 : return 2;break;
|
||||||
|
case 3 : return 3;break;
|
||||||
|
case 4 : return 8;break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
if(isodd(n)){
|
||||||
|
/*
|
||||||
|
TODO: find reasonable cutoff
|
||||||
|
df(2n + 1) = (2*n)!/(n!*2^n)
|
||||||
|
*/
|
||||||
|
if(n>0){
|
||||||
|
n = (n+1)//2;
|
||||||
|
return __CZ__double_factorial(n);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(n == -3 ) return -1;
|
||||||
|
n = ((-n)-1)/2;
|
||||||
|
return ((-1)^-n)/__CZ__double_factorial(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
/*
|
||||||
|
I'm undecided here. The formula for complex n is valid for the negative
|
||||||
|
integers, too.
|
||||||
|
*/
|
||||||
|
n = n>>1;
|
||||||
|
if(n>0){
|
||||||
|
if(!isdefined("test8900"))
|
||||||
|
return factorial(n)<<n;
|
||||||
|
else
|
||||||
|
return n!<<n;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return newerror("doublefactorial(n): even(n) < 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Algorithm 3.17,
|
||||||
|
Donald Kreher and Douglas Simpson,
|
||||||
|
Combinatorial Algorithms,
|
||||||
|
CRC Press, 1998, page 89.
|
||||||
|
*/
|
||||||
|
static __CZ__stirling1;
|
||||||
|
static __CZ__stirling1_n = -1;
|
||||||
|
static __CZ__stirling1_m = -1;
|
||||||
|
|
||||||
|
define stirling1(n,m){
|
||||||
|
local i j k;
|
||||||
|
if(n<0)return newerror("stirling1(n,m): n <= 0");
|
||||||
|
if(m<0)return newerror("stirling1(n,m): m < 0");
|
||||||
|
if(n<m) return 0;
|
||||||
|
if(n==m) return 1;
|
||||||
|
if(m==0 || n==0) return 0;
|
||||||
|
/* We always use the list */
|
||||||
|
/*
|
||||||
|
if(m=1){
|
||||||
|
if(iseven(n)) return -factorial(n-1);
|
||||||
|
else return factorial(n-1);
|
||||||
|
}
|
||||||
|
if(m == n-1){
|
||||||
|
if(iseven(n)) return -binomial(n,2);
|
||||||
|
else return -binomial(n,2);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if(__CZ__stirling1_n >= n && __CZ__stirling1_m >= m){
|
||||||
|
return __CZ__stirling1[n,m];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
__CZ__stirling1 = mat[n+1,m+1];
|
||||||
|
__CZ__stirling1[0,0] = 1;
|
||||||
|
for(i=1;i<=n;i++)
|
||||||
|
__CZ__stirling1[i,0] = 0;
|
||||||
|
for(i=1;i<=n;i++){
|
||||||
|
for(j=1;j<=m;j++){
|
||||||
|
if(j<=i){
|
||||||
|
__CZ__stirling1[i, j] = __CZ__stirling1[i - 1, j - 1] - (i - 1)\
|
||||||
|
* __CZ__stirling1[i - 1, j];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
__CZ__stirling1[i, j] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__CZ__stirling1_n = n;
|
||||||
|
__CZ__stirling1_m = m;
|
||||||
|
return __CZ__stirling1[n,m];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
define stirling2(n,m){
|
||||||
|
local k sum;
|
||||||
|
if(n<0)return newerror("stirling2(n,m): n < 0");
|
||||||
|
if(m<0)return newerror("stirling2(n,m): m < 0");
|
||||||
|
if(n<m) return 0;
|
||||||
|
if(n==0 && n!=m) return 0;
|
||||||
|
if(n==m) return 1;
|
||||||
|
if(m==0 )return 0;
|
||||||
|
if(m==1) return 1;
|
||||||
|
if(m==2) return 2^(n-1)-1;
|
||||||
|
/*
|
||||||
|
There are different methods to speed up alternating sums.
|
||||||
|
This one doesn't.
|
||||||
|
*/
|
||||||
|
if(isdefined("test8900")){
|
||||||
|
for(k=0;k<=m;k++){
|
||||||
|
sum += (-1)^(m-k)*comb(m,k)*k^n;
|
||||||
|
}
|
||||||
|
return sum/(m!);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for(k=0;k<=m;k++){
|
||||||
|
sum += (-1)^(m-k)*binomial(m,k)*k^n;
|
||||||
|
}
|
||||||
|
return sum/factorial(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static __CZ__stirling2;
|
||||||
|
static __CZ__stirling2_n = -1;
|
||||||
|
static __CZ__stirling2_m = -1;
|
||||||
|
define stirling2caching(n,m){
|
||||||
|
local nm i j ;
|
||||||
|
if(n<0)return newerror("stirling2iter(n,m): n < 0");
|
||||||
|
if(m<0)return newerror("stirling2iter(n,m): m < 0");
|
||||||
|
/* no shortcuts here */
|
||||||
|
|
||||||
|
if(n<m) return 0;
|
||||||
|
if(n==0 && n!=m) return 0;
|
||||||
|
if(n==m) return 1;
|
||||||
|
if(m==0 )return 0;
|
||||||
|
if(m==1) return 1;
|
||||||
|
if(m==2) return 2^(n-1)-1;
|
||||||
|
|
||||||
|
nm = n-m;
|
||||||
|
if(__CZ__stirling2_n >= n && __CZ__stirling2_m >= m){
|
||||||
|
return __CZ__stirling2[n,m];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
__CZ__stirling2 = mat[n+1,m+1];
|
||||||
|
__CZ__stirling2[0,0] = 1;
|
||||||
|
for(i=1;i<=n;i++){
|
||||||
|
__CZ__stirling2[i,0] = 0;
|
||||||
|
for(j=1;j<=m;j++){
|
||||||
|
if(j<=i){
|
||||||
|
__CZ__stirling2[i, j] = __CZ__stirling2[i -1, j -1] + (j )\
|
||||||
|
* __CZ__stirling2[i - 1, j];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
__CZ__stirling2[i, j] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__CZ__stirling2_n = (n);
|
||||||
|
__CZ__stirling2_m = (m);
|
||||||
|
return __CZ__stirling2[n,m];
|
||||||
|
}
|
||||||
|
|
||||||
|
define bell(n){
|
||||||
|
local sum s2list k A;
|
||||||
|
|
||||||
|
if(!isint(n)) return newerror("bell(n): n is not integer");
|
||||||
|
if(n < 0) return newerror("bell(n): n is not positive");
|
||||||
|
/* place some more shortcuts here?*/
|
||||||
|
if(n<=15){
|
||||||
|
mat A[16] = {
|
||||||
|
1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570,
|
||||||
|
4213597, 27644437, 190899322, 1382958545
|
||||||
|
};
|
||||||
|
return A[n];
|
||||||
|
}
|
||||||
|
/* Start by generating the list of stirling numbers of the second kind */
|
||||||
|
s2list = stirling2caching(n,n//2);
|
||||||
|
if(iserror(s2list))
|
||||||
|
return newerror("bell(n): could not build stirling num. list");
|
||||||
|
sum = 0;
|
||||||
|
for(k=1;k<=n;k++){
|
||||||
|
sum += stirling2caching(n,k);
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
define subfactorialrecursive(n){
|
||||||
|
if(n==0) return 1;
|
||||||
|
if(n==1) return 0;
|
||||||
|
if(n==2) return 1;
|
||||||
|
return n * subfactorialrecursive(n-1) + (-1)^n;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is, quite amusingely, faster than the very same algorithm in
|
||||||
|
PARI/GP + GMP*/
|
||||||
|
define subfactorialiterative(n){
|
||||||
|
local k temp1 temp2 ret;
|
||||||
|
if(n==0) return 1;
|
||||||
|
if(n==1) return 0;
|
||||||
|
if(n==2) return 1;
|
||||||
|
temp1 = 0;
|
||||||
|
ret = 1;
|
||||||
|
for(k=3;k<=n;k++){
|
||||||
|
temp2 = temp1;
|
||||||
|
temp1 = ret;
|
||||||
|
ret = (k-1) *(temp1 + temp2);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
define subfactorial(n){
|
||||||
|
local epsilon eps ret lnfact;
|
||||||
|
if(!isint(n))return newerror("subfactorial(n): n is not integer.");
|
||||||
|
if(n < 0)return newerror("subfactorial(n): n < 0");
|
||||||
|
return subfactorialiterative(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
define risingfactorial(x,n){
|
||||||
|
local num denom quot ret;
|
||||||
|
if(n == 1) return x;
|
||||||
|
if(x==0) return newerror("risingfactorial(x,n): x == 0");
|
||||||
|
if(!isint(x) || !isint(n)){
|
||||||
|
return gamma(x+n)/gamma(x);
|
||||||
|
}
|
||||||
|
if(x<1)return newerror("risingfactorial(x,n): integer x and x < 1");
|
||||||
|
if(x+n < 1)return newerror("risingfactorial(x,n): integer x+n and x+n < 1");
|
||||||
|
if(x<9000&&n<9000){
|
||||||
|
return (x+n-1)!/(x-1)!;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
num = __CZ__factor_factorial(x+n-1,1);
|
||||||
|
denom = __CZ__factor_factorial(x-1,1);
|
||||||
|
quot = __CZ__subtract_factored_factorials( num , denom );
|
||||||
|
free(num,denom);
|
||||||
|
ret = __CZ__multiply_factored_factorial(quot);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
define fallingfactorial(x,n){
|
||||||
|
local num denom quot ret;
|
||||||
|
if(n == 0) return 1;
|
||||||
|
|
||||||
|
if(!isint(x) || !isint(n)){
|
||||||
|
if(x == n) return gamma(x+1);
|
||||||
|
return gamma(x+1)/gamma(x-n+1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(x<0 || x-n < 0)
|
||||||
|
return newerror("fallingfactorial(x,n): integer x<0 or x-n < 0");
|
||||||
|
if(x == n) return factorial(x);
|
||||||
|
if(x<9000&&n<9000){
|
||||||
|
return (x)!/(x-n)!;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
num = __CZ__factor_factorial(x,1);
|
||||||
|
denom = __CZ__factor_factorial(x-n,1);
|
||||||
|
quot = __CZ__subtract_factored_factorials( num , denom );
|
||||||
|
free(num,denom);
|
||||||
|
ret = __CZ__multiply_factored_factorial(quot);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
* report important interface functions
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "binomial(n,k)";
|
||||||
|
print "bigcatalan(n)";
|
||||||
|
print "doublefactorial(n)";
|
||||||
|
print "subfactorial(n)";
|
||||||
|
print "stirling1(n,m)";
|
||||||
|
print "stirling2(n,m)";
|
||||||
|
print "stirling2caching(n,m)";
|
||||||
|
print "bell(n)";
|
||||||
|
print "subfactorial(n)";
|
||||||
|
print "risingfactorial(x,n)";
|
||||||
|
print "fallingfactorial(x,n)";
|
||||||
|
}
|
288
cal/lambertw.cal
Normal file
288
cal/lambertw.cal
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
/*
|
||||||
|
* lambertw - Lambert's W-function
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: lambertw.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lambertw.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
R. M. Corless and G. H. Gonnet and D. E. G. Hare and D. J. Jeffrey and
|
||||||
|
D. E. Knuth, "On the Lambert W Function", Advances n Computational
|
||||||
|
Mathematics, 329--359, (1996)
|
||||||
|
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.6117
|
||||||
|
|
||||||
|
D. J. Jeffrey, D. E. G. Hare, R. M. Corless, "Unwinding the branches of the
|
||||||
|
Lambert W function", The Mathematical Scientist, 21, pp 1-7, (1996)
|
||||||
|
http://www.apmaths.uwo.ca/~djeffrey/Offprints/wbranch.pdf
|
||||||
|
|
||||||
|
Darko Verebic, "Having Fun with Lambert W(x) Function"
|
||||||
|
arXiv:1003.1628v1, March 2010, http://arxiv.org/abs/1003.1628
|
||||||
|
|
||||||
|
Winitzki, S. "Uniform Approximations for Transcendental Functions",
|
||||||
|
In Part 1 of Computational Science and its Applications - ICCSA 2003,
|
||||||
|
Lecture Notes in Computer Science, Vol. 2667, Springer-Verlag,
|
||||||
|
Berlin, 2003, 780-789. DOI 10.1007/3-540-44839-X_82
|
||||||
|
A copy may be found by Google.
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
static true = 1;
|
||||||
|
static false = 0;
|
||||||
|
|
||||||
|
/* Branch 0, Winitzki (2003) , the well known Taylor series*/
|
||||||
|
define __CZ__lambertw_0(z,eps){
|
||||||
|
local a=2.344e0, b=0.8842e0, c=0.9294e0, d=0.5106e0, e=-1.213e0;
|
||||||
|
local y=sqrt(2*exp(1)*z+2);
|
||||||
|
return (2*ln(1+b*y)-ln(1+c*ln(1+d*y))+e)/(1+1/(2*ln(1+b*y)+2*a));
|
||||||
|
}
|
||||||
|
/* branch -1 */
|
||||||
|
define __CZ__lambertw_m1(z,eps){
|
||||||
|
local wn k;
|
||||||
|
/* Cut-off found in Maxima */
|
||||||
|
if(z < 0.3) return __CZ__lambertw_app(z,eps);
|
||||||
|
wn = z;
|
||||||
|
/* Verebic (2010) eqs. 16-18*/
|
||||||
|
for(k=0;k<10;k++){
|
||||||
|
wn = ln(-z)-ln(-wn);
|
||||||
|
}
|
||||||
|
return wn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
generic approximation
|
||||||
|
|
||||||
|
series for 1+W((z-2)/(2 e))
|
||||||
|
|
||||||
|
Corless et al (1996) (4.22)
|
||||||
|
Verebic (2010) eqs. 35-37; more coefficients given at the end of sect. 3.1
|
||||||
|
or online
|
||||||
|
http://www.wolframalpha.com/input/?
|
||||||
|
i=taylor+%28+1%2Bproductlog%28+%28z-2%29%2F%282*e%29+%29+%29
|
||||||
|
or by using the function lambertw_series_print() after running
|
||||||
|
lambertw_series(z,eps,branch,terms) at least once with the wanted number of
|
||||||
|
terms and z = 1 (which might throw an error because the series will not
|
||||||
|
converge in anybodies lifetime for something that far from the branchpoint).
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
define __CZ__lambertw_app(z,eps){
|
||||||
|
local b0=-1, b1=1, b2=-1/3, b3=11/72;
|
||||||
|
local y=sqrt(2*exp(1)*z+2);
|
||||||
|
return b0 + ( y * (b1 + (y * (b2 + (b3 * y)))));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __CZ__Ws_a;
|
||||||
|
static __CZ__Ws_c;
|
||||||
|
static __CZ__Ws_len=0;
|
||||||
|
|
||||||
|
define lambertw_series_print(){
|
||||||
|
local k;
|
||||||
|
for(k=0;k<__CZ__Ws_len;k++){
|
||||||
|
print num(__CZ__Ws_c[k]):"/":den(__CZ__Ws_c[k]):"*p^":k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
The series is fast but only if _very_ close to the branchpoint
|
||||||
|
The exact branch must be given explicitly, e.g.:
|
||||||
|
|
||||||
|
; lambertw(-exp(-1)+.001)-lambertw_series(-exp(-1)+.001,epsilon()*1e-10,0)
|
||||||
|
-0.14758879113205794065490184399030194122136720202792-
|
||||||
|
0.00000000000000000000000000000000000000000000000000i
|
||||||
|
; lambertw(-exp(-1)+.001)-lambertw_series(-exp(-1)+.001,epsilon()*1e-10,1)
|
||||||
|
0.00000000000000000000000000000000000000000000000000-
|
||||||
|
0.00000000000000000000000000000000000000000000000000i
|
||||||
|
*/
|
||||||
|
define lambertw_series(z,eps,branch,terms){
|
||||||
|
local k l limit tmp sum A C P PP epslocal;
|
||||||
|
if(!isnull(terms))
|
||||||
|
limit = terms;
|
||||||
|
else
|
||||||
|
limit = 100;
|
||||||
|
|
||||||
|
if(isnull(eps))
|
||||||
|
eps = epsilon(epsilon()*1e-10);
|
||||||
|
epslocal = epsilon(eps);
|
||||||
|
|
||||||
|
P = sqrt(2*(exp(1)*z+1));
|
||||||
|
if(branch != 0) P = -P;
|
||||||
|
tmp=0;sum=0;PP=P;
|
||||||
|
|
||||||
|
__CZ__Ws_a = mat[limit+1];
|
||||||
|
__CZ__Ws_c = mat[limit+1];
|
||||||
|
__CZ__Ws_len = limit;
|
||||||
|
/*
|
||||||
|
c0 = -1; c1 = 1
|
||||||
|
a0 = 2; a1 =-1
|
||||||
|
*/
|
||||||
|
__CZ__Ws_c[0] = -1; __CZ__Ws_c[1] = 1;
|
||||||
|
__CZ__Ws_a[0] = 2; __CZ__Ws_a[1] = -1;
|
||||||
|
sum += __CZ__Ws_c[0];
|
||||||
|
sum += __CZ__Ws_c[1] * P;
|
||||||
|
PP *= P;
|
||||||
|
for(k=2;k<limit;k++){
|
||||||
|
for(l=2;l<k;l++){
|
||||||
|
__CZ__Ws_a[k] += __CZ__Ws_c[l]*__CZ__Ws_c[k+1-l];
|
||||||
|
}
|
||||||
|
|
||||||
|
__CZ__Ws_c[k] = (k-1) * ( __CZ__Ws_c[k-2]/2
|
||||||
|
+__CZ__Ws_a[k-2]/4)/
|
||||||
|
(k+1)-__CZ__Ws_a[k]/2-__CZ__Ws_c[k-1]/(k+1);
|
||||||
|
tmp = __CZ__Ws_c[k] * PP;
|
||||||
|
sum += tmp;
|
||||||
|
if(abs(tmp) <= eps){
|
||||||
|
epsilon(epslocal);
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
PP *= P;
|
||||||
|
}
|
||||||
|
epsilon(epslocal);
|
||||||
|
return
|
||||||
|
newerror(strcat("lambertw_series: does not converge in ",
|
||||||
|
str(limit)," terms" ));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
||||||
|
define lambertw(z,branch){
|
||||||
|
local eps epslarge ret branchpoint bparea w we ew w1e wn k places m1e;
|
||||||
|
local closeness;
|
||||||
|
|
||||||
|
eps = epsilon();
|
||||||
|
if(branch == 0){
|
||||||
|
if(!im(z)){
|
||||||
|
if(abs(z) <= eps) return 0;
|
||||||
|
if(abs(z-exp(1)) <= eps) return 1;
|
||||||
|
if(abs(z - (-ln(2)/2)) <= eps ) return -ln(2);
|
||||||
|
if(abs(z - (-pi()/2)) <= eps ) return 1i*pi()/2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
branchpoint = -exp(-1);
|
||||||
|
bparea = .2;
|
||||||
|
if(branch == 0){
|
||||||
|
if(!im(z) && abs(z-branchpoint) == 0) return -1;
|
||||||
|
ret = __CZ__lambertw_0(z,eps);
|
||||||
|
/* Yeah, C&P, I know, sorry */
|
||||||
|
##ret = ln(z) + 2*pi()*1i*branch - ln(ln(z)+2*pi()*1i*branch);
|
||||||
|
}
|
||||||
|
else if(branch == 1){
|
||||||
|
if(im(z)<0 && abs(z-branchpoint) <= bparea)
|
||||||
|
ret = __CZ__lambertw_app(z,eps);
|
||||||
|
/* Does calc have a goto? Oh, it does! */
|
||||||
|
ret =ln(z) + 2*pi()*1i*branch - ln(ln(z)+2*pi()*1i*branch);
|
||||||
|
}
|
||||||
|
else if(branch == -1){##print "-1";
|
||||||
|
if(!im(z) && abs(z-branchpoint) == 0) return -1;
|
||||||
|
if(!im(z) && z>branchpoint && z < 0){##print "0";
|
||||||
|
ret = __CZ__lambertw_m1(z,eps);}
|
||||||
|
if(im(z)>=0 && abs(z-branchpoint) <= bparea){##print "1";
|
||||||
|
ret = __CZ__lambertw_app(z,eps);}
|
||||||
|
ret =ln(z) + 2*pi()*1i*branch - ln(ln(z)+2*pi()*1i*branch);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ret = ln(z) + 2*pi()*1i*branch - ln(ln(z)+2*pi()*1i*branch);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Such a high precision is only needed _very_ close to the branchpoint
|
||||||
|
and might even be insufficient if z has not been computed with
|
||||||
|
sufficient precision itself (M below was calculated by Mathematica and also
|
||||||
|
with the series above with epsilon(1e-200)):
|
||||||
|
; epsilon(1e-50)
|
||||||
|
0.00000000000000000001
|
||||||
|
; display(50)
|
||||||
|
20
|
||||||
|
; M=-0.9999999999999999999999997668356018402875796636464119050387
|
||||||
|
; lambertw(-exp(-1)+1e-50,0)-M
|
||||||
|
-0.00000000000000000000000002678416515423276355643684
|
||||||
|
; epsilon(1e-60)
|
||||||
|
0.0000000000000000000000000000000000000000000000000
|
||||||
|
; A=-exp(-1)+1e-50
|
||||||
|
; epsilon(1e-50)
|
||||||
|
0.00000000000000000000000000000000000000000000000000
|
||||||
|
; lambertw(A,0)-M
|
||||||
|
-0.00000000000000000000000000000000000231185460220585
|
||||||
|
; lambertw_series(A,epsilon(),0)-M
|
||||||
|
-0.00000000000000000000000000000000000132145133161626
|
||||||
|
; epsilon(1e-100)
|
||||||
|
0.00000000000000000000000000000000000000000000000001
|
||||||
|
; A=-exp(-1)+1e-50
|
||||||
|
; epsilon(1e-65)
|
||||||
|
0.00000000000000000000000000000000000000000000000000
|
||||||
|
; lambertw_series(A,epsilon(),0)-M
|
||||||
|
0.00000000000000000000000000000000000000000000000000
|
||||||
|
; lambertw_series(-exp(-1)+1e-50,epsilon(),0)-M
|
||||||
|
-0.00000000000000000000000000000000000000002959444084
|
||||||
|
; epsilon(1e-74)
|
||||||
|
0.00000000000000000000000000000000000000000000000000
|
||||||
|
; lambertw_series(-exp(-1)+1e-50,epsilon(),0)-M
|
||||||
|
-0.00000000000000000000000000000000000000000000000006
|
||||||
|
*/
|
||||||
|
closeness = abs(z-branchpoint);
|
||||||
|
if( closeness< 1){
|
||||||
|
if(closeness != 0)
|
||||||
|
eps = epsilon(epsilon()*( closeness));
|
||||||
|
else
|
||||||
|
eps = epsilon(epsilon()^2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
eps = epsilon(epsilon()*1e-2);
|
||||||
|
|
||||||
|
|
||||||
|
epslarge =epsilon();
|
||||||
|
|
||||||
|
places = highbit(1 + int(1/epslarge)) + 1;
|
||||||
|
w = ret;
|
||||||
|
for(k=0;k<100;k++){
|
||||||
|
ew = exp(w);
|
||||||
|
we = w*ew;
|
||||||
|
if(abs(we-z)<= 4*epslarge*abs(z))break;
|
||||||
|
w1e = (1+w)*ew;
|
||||||
|
wn = bround(w- ((we - z) / ( w1e - ( (w+2)*(we-z) )/(2*w+2) ) ),places++) ;
|
||||||
|
if( abs(wn - w) <= epslarge*abs(wn)) break;
|
||||||
|
else w = wn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(k==100){
|
||||||
|
epsilon(eps);
|
||||||
|
return newerror("lambertw: Halley iteration does not converge");
|
||||||
|
}
|
||||||
|
/* The Maxima coders added a check if the iteration converged to the correct
|
||||||
|
branch. This coder deems it superfluous. */
|
||||||
|
|
||||||
|
epsilon(eps);
|
||||||
|
return wn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "lambertw(z,branch)";
|
||||||
|
print "lambertw_series(z,eps,branch,terms)";
|
||||||
|
print "lambertw_series_print()";
|
||||||
|
}
|
112
cal/lnseries.cal
Normal file
112
cal/lnseries.cal
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/*
|
||||||
|
* lnseries - special functions (e.g.: gamma, zeta, psi)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: lnseries.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lnseries.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hide internal function from resource debugging
|
||||||
|
*/
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
static __CZ__int_logs;
|
||||||
|
static __CZ__int_logs_limit;
|
||||||
|
static __CZ__int_logs_prec;
|
||||||
|
|
||||||
|
|
||||||
|
define deletelnseries(){
|
||||||
|
free(__CZ__int_logs,__CZ__int_logs_limit,__CZ__int_logs_prec);
|
||||||
|
}
|
||||||
|
|
||||||
|
define lnfromseries(n){
|
||||||
|
if( isnull(__CZ__int_logs)
|
||||||
|
|| __CZ__int_logs_limit < n
|
||||||
|
|| __CZ__int_logs_prec < log(1/epsilon())){
|
||||||
|
|
||||||
|
lnseries(n+1);
|
||||||
|
}
|
||||||
|
return __CZ__int_logs[n,0];
|
||||||
|
}
|
||||||
|
|
||||||
|
define lnseries(limit){
|
||||||
|
local k j eps ;
|
||||||
|
if( isnull(__CZ__int_logs)
|
||||||
|
|| __CZ__int_logs_limit < limit
|
||||||
|
|| __CZ__int_logs_prec < log(1/epsilon())){
|
||||||
|
__CZ__int_logs = mat[limit+1,2];
|
||||||
|
__CZ__int_logs_limit = limit;
|
||||||
|
__CZ__int_logs_prec = log(1/epsilon());
|
||||||
|
|
||||||
|
/* probably still too much */
|
||||||
|
eps = epsilon(epsilon()*10^(-(5+log(limit))));
|
||||||
|
k =2;
|
||||||
|
while(1){
|
||||||
|
/* the prime itself, compute logarithm */
|
||||||
|
__CZ__int_logs[k,0] = ln(k);
|
||||||
|
__CZ__int_logs[k,1] = k;
|
||||||
|
|
||||||
|
for(j = 2*k;j<=limit;j+=k){
|
||||||
|
/* multiples of prime k, add logarithm of k computed earlier */
|
||||||
|
__CZ__int_logs[j,0] += __CZ__int_logs[k,0];
|
||||||
|
/* First hit, set counter to number */
|
||||||
|
if(__CZ__int_logs[j,1] ==0)
|
||||||
|
__CZ__int_logs[j,1]=j;
|
||||||
|
/* reduce counter by prime added */
|
||||||
|
__CZ__int_logs[j,1] //= __CZ__int_logs[k,1];
|
||||||
|
}
|
||||||
|
|
||||||
|
k++;
|
||||||
|
if(k>=limit) break;
|
||||||
|
/* Erastothenes-sieve: look for next prime. */
|
||||||
|
while(__CZ__int_logs[k,0]!=0){
|
||||||
|
k++;
|
||||||
|
if(k>=limit) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Second run to include the last factor */
|
||||||
|
for(k=1;k<=limit;k++){
|
||||||
|
if(__CZ__int_logs[k,1] != k){
|
||||||
|
__CZ__int_logs[k,0] +=__CZ__int_logs[ __CZ__int_logs[k,1],0];
|
||||||
|
__CZ__int_logs[k,1] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
epsilon(eps);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "lnseries(limit)";
|
||||||
|
print "lnfromseries(n)";
|
||||||
|
print "deletelnseries()";
|
||||||
|
}
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: quat.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
|
* @(#) $Id: quat.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/quat.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/quat.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:50:35
|
* Under source code control: 1990/02/15 01:50:35
|
||||||
@@ -55,7 +55,8 @@ define quat(a,b,c,d)
|
|||||||
|
|
||||||
define quat_print(a)
|
define quat_print(a)
|
||||||
{
|
{
|
||||||
print "quat(" : a.s : ", " : a.v[0] : ", " : a.v[1] : ", " : a.v[2] : ")" :;
|
print "quat(" : a.s : ", " : a.v[0] : ", " :
|
||||||
|
a.v[1] : ", " : a.v[2] : ")" :;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
136
cal/regress.cal
136
cal/regress.cal
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.6 $
|
* @(#) $Revision: 30.10 $
|
||||||
* @(#) $Id: regress.cal,v 30.6 2010/09/02 06:09:06 chongo Exp $
|
* @(#) $Id: regress.cal,v 30.10 2013/09/01 22:08:44 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/regress.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/regress.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:50:36
|
* Under source code control: 1990/02/15 01:50:36
|
||||||
@@ -1397,7 +1397,8 @@ define test_functions()
|
|||||||
vrfy(quomod(10,-3,a,b,12) == 1, '1193: vrfy(quomod(10,-3,a,b,12) == 1');
|
vrfy(quomod(10,-3,a,b,12) == 1, '1193: vrfy(quomod(10,-3,a,b,12) == 1');
|
||||||
vrfy(a == -3, '1194: a == -3');
|
vrfy(a == -3, '1194: a == -3');
|
||||||
vrfy(b == 1, '1195: b == 1');
|
vrfy(b == 1, '1195: b == 1');
|
||||||
vrfy(quomod(-10,-3,a,b,13) == 1,'1196: vrfy(quomod(-10,-3,a,b,13) == 1');
|
vrfy(quomod(-10,-3,a,b,13) == 1,
|
||||||
|
'1196: vrfy(quomod(-10,-3,a,b,13) == 1');
|
||||||
vrfy(a == 4, '1197: a == 4');
|
vrfy(a == 4, '1197: a == 4');
|
||||||
vrfy(b == 2, '1198: b == 2');
|
vrfy(b == 2, '1198: b == 2');
|
||||||
vrfy(quomod(10,3,a,b,14) == 1, '1199: vrfy(quomod(10,3,a,b,14) == 1');
|
vrfy(quomod(10,3,a,b,14) == 1, '1199: vrfy(quomod(10,3,a,b,14) == 1');
|
||||||
@@ -1444,7 +1445,93 @@ define test_functions()
|
|||||||
vrfy(jacobi(-1,-1) == 0, '1236: jacobi(-1,-1) == 0');
|
vrfy(jacobi(-1,-1) == 0, '1236: jacobi(-1,-1) == 0');
|
||||||
vrfy(jacobi(0,-1) == 0, '1237: jacobi(0,-1) == 0');
|
vrfy(jacobi(0,-1) == 0, '1237: jacobi(0,-1) == 0');
|
||||||
|
|
||||||
print '1238: Ending test_functions';
|
/* ctype function tests */
|
||||||
|
vrfy(isalnum("A") == 1, '1238: isalnum("A") == 1');
|
||||||
|
vrfy(isalnum("a") == 1, '1239: isalnum("a") == 1');
|
||||||
|
vrfy(isalnum("2") == 1, '1239: isalnum("2") == 1');
|
||||||
|
vrfy(isalnum("\t") == 0, '1240: isalnum("\t") == 0');
|
||||||
|
|
||||||
|
vrfy(isalpha("A") == 1, '1241: isalpha("A") == 1');
|
||||||
|
vrfy(isalpha("a") == 1, '1242: isalpha("a") == 1');
|
||||||
|
vrfy(isalpha("2") == 0, '1243: isalpha("2") == 0');
|
||||||
|
vrfy(isalpha("\t") == 0, '1244: isalpha("\t") == 0');
|
||||||
|
|
||||||
|
vrfy(iscntrl("A") == 0, '1245: iscntrl("A") == 0');
|
||||||
|
vrfy(iscntrl("a") == 0, '1246: iscntrl("a") == 0');
|
||||||
|
vrfy(iscntrl("2") == 0, '1247: iscntrl("2") == 0');
|
||||||
|
vrfy(iscntrl("\t") == 1, '1248: iscntrl("\t") == 1');
|
||||||
|
|
||||||
|
vrfy(isdigit("A") == 0, '1249: isdigit("A") == 0');
|
||||||
|
vrfy(isdigit("a") == 0, '1250: isdigit("a") == 0');
|
||||||
|
vrfy(isdigit("2") == 1, '1251: isdigit("2") == 1');
|
||||||
|
vrfy(isdigit("\t") == 0, '1252: isdigit("\t") == 0');
|
||||||
|
|
||||||
|
vrfy(isgraph("A") == 1, '1253: isgraph("A") == 1');
|
||||||
|
vrfy(isgraph("a") == 1, '1254: isgraph("a") == 1');
|
||||||
|
vrfy(isgraph("2") == 1, '1255: isgraph("2") == 1');
|
||||||
|
vrfy(isgraph("\t") == 0, '1255: isgraph("\t") == 0');
|
||||||
|
|
||||||
|
vrfy(islower("A") == 0, '1256: islower("A") == 0');
|
||||||
|
vrfy(islower("a") == 1, '1257: islower("a") == 1');
|
||||||
|
vrfy(islower("1") == 0, '1258: islower("1") == 0');
|
||||||
|
|
||||||
|
vrfy(isprint("A") == 1, '1259: isprint("A") == 1');
|
||||||
|
vrfy(isprint("a") == 1, '1260: isprint("a") == 1');
|
||||||
|
vrfy(isprint(" ") == 1, '1261: isprint(" ") == 1');
|
||||||
|
vrfy(isprint("\t") == 0, '1262: isprint("\t") == 0');
|
||||||
|
|
||||||
|
vrfy(ispunct("A") == 0, '1263: ispunct("A") == 0');
|
||||||
|
vrfy(ispunct("a") == 0, '1264: ispunct("a") == 0');
|
||||||
|
vrfy(ispunct(" ") == 0, '1265: ispunct(" ") == 0');
|
||||||
|
vrfy(ispunct("?") == 1, '1266: ispunct("?") == 1');
|
||||||
|
|
||||||
|
vrfy(isspace("A") == 0, '1267: isspace("A") == 0');
|
||||||
|
vrfy(isspace("Krik") == 0, '1268: isspace("Krik") == 0');
|
||||||
|
vrfy(isspace(" ") == 1, '1269: isspace(" ") == 1');
|
||||||
|
vrfy(isspace("?") == 0, '1270: isspace("?") == 0');
|
||||||
|
|
||||||
|
vrfy(isupper("A") == 1, '1271: isupper("A") == 1');
|
||||||
|
vrfy(isupper("a") == 0, '1272: isupper("a") == 0');
|
||||||
|
vrfy(isupper("1") == 0, '1273: isupper("1") == 0');
|
||||||
|
|
||||||
|
vrfy(isxdigit("A") == 1, '1274: isxdigit("A") == 1');
|
||||||
|
vrfy(isxdigit("f") == 1, '1275: isxdigit("f") == 1');
|
||||||
|
vrfy(isxdigit("2") == 1, '1276: isxdigit("2") == 1');
|
||||||
|
vrfy(isxdigit("x") == 0, '1277: isxdigit("x") == 0');
|
||||||
|
|
||||||
|
vrfy(strcasecmp("ab", "aBc") == -1,
|
||||||
|
'1278: strcasecmp("ab", "aBc") == -1');
|
||||||
|
vrfy(strcasecmp("abc", "aBb") == 1,
|
||||||
|
'1279: strcasecmp("abc", "aBb") == 1');
|
||||||
|
vrfy(strcasecmp("abc", "abc") == 0,
|
||||||
|
'1280: strcasecmp("abc", "abc") == 0');
|
||||||
|
vrfy(strcasecmp("abc", "aBc") == 0,
|
||||||
|
'1281: strcasecmp("abc", "aBc") == 0');
|
||||||
|
vrfy(strcasecmp("abc", "aBd") == -1,
|
||||||
|
'1282: strcasecmp("abc", "aBd") == -1');
|
||||||
|
vrfy(strcasecmp("abc\0", "aBc") == 1,
|
||||||
|
'1283: strcasecmp("abc\0", "aBc") == 1');
|
||||||
|
vrfy(strcasecmp("a\0b", "A\0c") == -1,
|
||||||
|
'1284: strcasecmp("a\0b", "A\0c") == -1');
|
||||||
|
|
||||||
|
vrfy(strncasecmp("abc", "xyz", 0) == 0,
|
||||||
|
'1285: strncasecmp("abc", "xyz", 0) == 0');
|
||||||
|
vrfy(strncasecmp("abc", "xyz", 1) == -1,
|
||||||
|
'1286: strncasecmp("abc", "xyz", 1) == -1');
|
||||||
|
vrfy(strncasecmp("abc", "", 1) == 1,
|
||||||
|
'1287: strncasecmp("abc", "", 1) == 1');
|
||||||
|
vrfy(strncasecmp("a", "b", 2) == -1,
|
||||||
|
'1288: strncasecmp("a", "b", 2) == -1');
|
||||||
|
vrfy(strncasecmp("ab", "Ac", 2) == -1,
|
||||||
|
'1289: strncasecmp("ab", "Ac", 2) == -1');
|
||||||
|
vrfy(strncasecmp("\0ac", "\0b", 2) == -1,
|
||||||
|
'1290: strncasecmp("\0ac", "\0b", 2) == -1');
|
||||||
|
vrfy(strncasecmp("ab", "aBc", 2) == 0,
|
||||||
|
'1291: strncasecmp("ab", "aBc", 2) == 0');
|
||||||
|
vrfy(strncasecmp("abc", "abd", 2) == 0,
|
||||||
|
'1292: strncasecmp("abc", "abd", 2) == 0');
|
||||||
|
|
||||||
|
print '1293: Ending test_functions';
|
||||||
}
|
}
|
||||||
print '017: parsed test_functions()';
|
print '017: parsed test_functions()';
|
||||||
|
|
||||||
@@ -1461,14 +1548,14 @@ define _test_underscore()
|
|||||||
local _a = 27;
|
local _a = 27;
|
||||||
local __a = 23209;
|
local __a = 23209;
|
||||||
|
|
||||||
print "1290: Beginning _test_underscore";
|
print "1294: Beginning _test_underscore";
|
||||||
|
|
||||||
vrfy(_a == 27, '1291: _a == 27');
|
vrfy(_a == 27, '1295: _a == 27');
|
||||||
vrfy(_ == 49, '1292: _ == 49');
|
vrfy(_ == 49, '1296: _ == 49');
|
||||||
vrfy(__ == 63, '1293: __ == 63');
|
vrfy(__ == 63, '1297: __ == 63');
|
||||||
vrfy(__a == 23209, '1294: __a == 23209');
|
vrfy(__a == 23209, '1298: __a == 23209');
|
||||||
|
|
||||||
print "1295: Ending _test_underscore";
|
print "1299: Ending _test_underscore";
|
||||||
}
|
}
|
||||||
print '020: parsed _test_underscore';
|
print '020: parsed _test_underscore';
|
||||||
|
|
||||||
@@ -1509,8 +1596,10 @@ define test_assoc()
|
|||||||
vrfy(isnull(search(a,16)), '1312: isnull(search(a,16))');
|
vrfy(isnull(search(a,16)), '1312: isnull(search(a,16))');
|
||||||
a["curds","whey"] = "spider";
|
a["curds","whey"] = "spider";
|
||||||
print '1313: a["curds","whey"] = "spider"';
|
print '1313: a["curds","whey"] = "spider"';
|
||||||
vrfy(a["curds","whey"] == "spider", '1314: a["curds","whey"] == "spider"');
|
vrfy(a["curds","whey"] == "spider",
|
||||||
vrfy(a[[rsearch(a,"spider")]] == "spider", '1315: a[[rsearch(a,"spider")]] == "spider"');
|
'1314: a["curds","whey"] == "spider"');
|
||||||
|
vrfy(a[[rsearch(a,"spider")]] == "spider",
|
||||||
|
'1315: a[[rsearch(a,"spider")]] == "spider"');
|
||||||
b = a;
|
b = a;
|
||||||
print '1316: b = a';
|
print '1316: b = a';
|
||||||
vrfy(b[17] == 19, '1317: b[17] == 19');
|
vrfy(b[17] == 19, '1317: b[17] == 19');
|
||||||
@@ -4892,7 +4981,8 @@ define test_newsyn()
|
|||||||
vrfy(s5500 == 55, '5510: s5500 == 45');
|
vrfy(s5500 == 55, '5510: s5500 == 45');
|
||||||
vrfy(i == 11, '5511: i == 11');
|
vrfy(i == 11, '5511: i == 11');
|
||||||
}
|
}
|
||||||
print "5512: { local i; for (s5500 = 0, i = 0; i < 10; i++) s5500 += i; ... }";
|
print "5512: { local i; for (s5500 = 0, i = 0; i < 10; i++) ":
|
||||||
|
"s5500 += i; ... }";
|
||||||
vrfy(s5500 == 55, '5513: s5500 == 55');
|
vrfy(s5500 == 55, '5513: s5500 == 55');
|
||||||
vrfy(i == 11, '5514: i == 11');
|
vrfy(i == 11, '5514: i == 11');
|
||||||
|
|
||||||
@@ -5027,7 +5117,7 @@ vrfy(i == 9, '151: i == 9');
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* test_commaeq - test changes to , and =
|
* test_commaeq - test changes to = and ,
|
||||||
*/
|
*/
|
||||||
obj xx5600 {} xx5600;
|
obj xx5600 {} xx5600;
|
||||||
print '152: obj xx5600 {} xx5600';
|
print '152: obj xx5600 {} xx5600';
|
||||||
@@ -6506,7 +6596,8 @@ define test_blk()
|
|||||||
/* A second named block */
|
/* A second named block */
|
||||||
|
|
||||||
B1 = blk("+++6700", 15, 10) = {1,2,3,4,5};
|
B1 = blk("+++6700", 15, 10) = {1,2,3,4,5};
|
||||||
print '6746: B1 = blk("+++6700", 15 , 10) = {1,2,3,4,5};';
|
print
|
||||||
|
'6746: B1 = blk("+++6700", 15 , 10) = {1,2,3,4,5};';
|
||||||
vrfy(size(B1) == 15, '6747: size(B1) == 15');
|
vrfy(size(B1) == 15, '6747: size(B1) == 15');
|
||||||
vrfy(sizeof(B1) == 20, '6748: sizeof(B1) == 20');
|
vrfy(sizeof(B1) == 20, '6748: sizeof(B1) == 20');
|
||||||
vrfy(test(B1) == 1, '6749: test(B1) == 1');
|
vrfy(test(B1) == 1, '6749: test(B1) == 1');
|
||||||
@@ -6871,7 +6962,8 @@ define test_sha1()
|
|||||||
|
|
||||||
|
|
||||||
z = sha1(list(1,2,3), "curds and whey", 2^21701-1, pi(1e-100));
|
z = sha1(list(1,2,3), "curds and whey", 2^21701-1, pi(1e-100));
|
||||||
print '7210: z = sha1(list(1,2,3), "curds and whey", 2^21701-1, pi(1e-100));';
|
print '7210: z = sha1(list(1,2,3), "curds and whey",',
|
||||||
|
'2^21701-1, pi(1e-100));';
|
||||||
vrfy(sha1(z) == 0x158cc87deeb9dd478ca14e3ab359205b0fb15b83,
|
vrfy(sha1(z) == 0x158cc87deeb9dd478ca14e3ab359205b0fb15b83,
|
||||||
'7211: sha1(z) == 0x158cc87deeb9dd478ca14e3ab359205b0fb15b83');
|
'7211: sha1(z) == 0x158cc87deeb9dd478ca14e3ab359205b0fb15b83');
|
||||||
|
|
||||||
@@ -7914,6 +8006,18 @@ return test_exponentiation();
|
|||||||
/* 88xx: test exponentiation */
|
/* 88xx: test exponentiation */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* calc resource functions by Christoph Zurnieden
|
||||||
|
*/
|
||||||
|
print;
|
||||||
|
print '8900: Starting test of calc resource functions by Christoph Zurnieden';
|
||||||
|
print '8901: read -once "test8900"';
|
||||||
|
read -once "test8900";
|
||||||
|
print '8902: about to run test8900(1,,8903)';
|
||||||
|
testnum = test8900(1,,8903);
|
||||||
|
/* 89xx: test calc resource functions by Christoph Zurnieden */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* read various calc resource files
|
* read various calc resource files
|
||||||
*
|
*
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: solve.cal,v 30.2 2008/05/10 13:30:00 chongo Exp $
|
* @(#) $Id: solve.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/solve.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/solve.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:50:37
|
* Under source code control: 1990/02/15 01:50:37
|
||||||
@@ -52,7 +52,8 @@ define solve(low, high, epsilon)
|
|||||||
if (sgn(flow) == sgn(fhigh))
|
if (sgn(flow) == sgn(fhigh))
|
||||||
quit "Non-opposite signs";
|
quit "Non-opposite signs";
|
||||||
while (1) {
|
while (1) {
|
||||||
mid = bround(high - fhigh * (high - low) / (fhigh - flow), places);
|
mid = bround(high - fhigh * (high - low) / (fhigh - flow),
|
||||||
|
places);
|
||||||
if ((mid == low) || (mid == high))
|
if ((mid == low) || (mid == high))
|
||||||
places++;
|
places++;
|
||||||
fmid = f(mid);
|
fmid = f(mid);
|
||||||
|
1469
cal/specialfunctions.cal
Normal file
1469
cal/specialfunctions.cal
Normal file
File diff suppressed because it is too large
Load Diff
502
cal/statistics.cal
Normal file
502
cal/statistics.cal
Normal file
@@ -0,0 +1,502 @@
|
|||||||
|
/*
|
||||||
|
* statistics - Some assorted statistics functions.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: statistics.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/statistics.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get dependencies
|
||||||
|
*/
|
||||||
|
read -once factorial2 brentsolve
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Continuous distributions
|
||||||
|
*
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/* regularized incomplete gamma function like in Octave, hence the name */
|
||||||
|
define gammaincoctave(z,a){
|
||||||
|
local tmp;
|
||||||
|
tmp = gamma(z);
|
||||||
|
return (tmp-gammainc(a,z))/tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inverse incomplete beta function. Old and slow. */
|
||||||
|
static __CZ__invbeta_a;
|
||||||
|
static __CZ__invbeta_b;
|
||||||
|
static __CZ__invbeta_x;
|
||||||
|
define __CZ__invbeta(x){
|
||||||
|
return __CZ__invbeta_x-__CZ__ibetaas63(x,__CZ__invbeta_a,__CZ__invbeta_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
define invbetainc_slow(x,a,b){
|
||||||
|
local flag ret eps;
|
||||||
|
/* place checks and balances here */
|
||||||
|
eps = epsilon();
|
||||||
|
if(.5 < x){
|
||||||
|
__CZ__invbeta_x = 1 - x;
|
||||||
|
__CZ__invbeta_a = b;
|
||||||
|
__CZ__invbeta_b = a;
|
||||||
|
flag = 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
__CZ__invbeta_x = x;
|
||||||
|
__CZ__invbeta_a = a;
|
||||||
|
__CZ__invbeta_b = b;
|
||||||
|
flag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = brentsolve2(0,1,1);
|
||||||
|
|
||||||
|
if(flag == 1)
|
||||||
|
ret = 1-ret;
|
||||||
|
epsilon(eps);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inverse incomplete beta function. Still old but not as slow as the function
|
||||||
|
above. */
|
||||||
|
/*
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
invbetainc computes inverse of the incomplete Beta function.
|
||||||
|
|
||||||
|
Licensing:
|
||||||
|
|
||||||
|
This code is distributed under the GNU LGPL license.
|
||||||
|
|
||||||
|
Modified:
|
||||||
|
|
||||||
|
10 August 2013
|
||||||
|
|
||||||
|
Author:
|
||||||
|
|
||||||
|
Original FORTRAN77 version by GW Cran, KJ Martin, GE Thomas.
|
||||||
|
C version by John Burkardt.
|
||||||
|
Calc version by Christoph Zurnieden
|
||||||
|
|
||||||
|
Reference:
|
||||||
|
|
||||||
|
GW Cran, KJ Martin, GE Thomas,
|
||||||
|
Remark AS R19 and Algorithm AS 109:
|
||||||
|
A Remark on Algorithms AS 63: The Incomplete Beta Integral
|
||||||
|
and AS 64: Inverse of the Incomplete Beta Integeral,
|
||||||
|
Applied Statistics,
|
||||||
|
Volume 26, Number 1, 1977, pages 111-114.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
Input, P, Q, the parameters of the incomplete
|
||||||
|
Beta function.
|
||||||
|
|
||||||
|
Input, BETA, the logarithm of the value of
|
||||||
|
the complete Beta function.
|
||||||
|
|
||||||
|
Input, ALPHA, the value of the incomplete Beta
|
||||||
|
function. 0 <= ALPHA <= 1.
|
||||||
|
|
||||||
|
Output, the argument of the incomplete
|
||||||
|
Beta function which produces the value ALPHA.
|
||||||
|
|
||||||
|
Local Parameters:
|
||||||
|
|
||||||
|
Local, SAE, the most negative decimal exponent
|
||||||
|
which does not cause an underflow.
|
||||||
|
*/
|
||||||
|
define invbetainc(x,a,b){
|
||||||
|
return __CZ__invbetainc(a,b,lnbeta(a,b),x);
|
||||||
|
}
|
||||||
|
|
||||||
|
define __CZ__invbetainc(p,q,beta,alpha){
|
||||||
|
local a acu adj fpu g h iex indx pp prev qq r s sae sq t tx value;
|
||||||
|
local w xin y yprev places eps;
|
||||||
|
|
||||||
|
/* Dirty trick, don't try at home */
|
||||||
|
eps= epsilon(epsilon()^2);
|
||||||
|
sae = -((log(1/epsilon())/log(2))//2);
|
||||||
|
fpu = 10.0^sae;
|
||||||
|
|
||||||
|
places = highbit(1 + int(1/epsilon())) + 1;
|
||||||
|
value = alpha;
|
||||||
|
if( p <= 0.0 ){
|
||||||
|
epsilon(eps);
|
||||||
|
return newerror("invbeta: argument p <= 0");
|
||||||
|
}
|
||||||
|
if( q <= 0.0 ){
|
||||||
|
epsilon(eps);
|
||||||
|
return newerror("invbeta: argument q <= 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
if( alpha < 0.0 || 1.0 < alpha ){
|
||||||
|
epsilon(eps);
|
||||||
|
return newerror("invbeta: argument alpha out of domain");
|
||||||
|
}
|
||||||
|
if( alpha == 0.0 ){
|
||||||
|
epsilon(eps);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if( alpha == 1.0 ){
|
||||||
|
epsilon(eps);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( 0.5 < alpha ){
|
||||||
|
a = 1.0 - alpha;
|
||||||
|
pp = q;
|
||||||
|
qq = p;
|
||||||
|
indx = 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
a = alpha;
|
||||||
|
pp = p;
|
||||||
|
qq = q;
|
||||||
|
indx = 0;
|
||||||
|
}
|
||||||
|
r = sqrt ( - ln ( a * a ) );
|
||||||
|
|
||||||
|
y = r-(2.30753+0.27061*r)/(1.0+(0.99229+0.04481*r)*r);
|
||||||
|
|
||||||
|
if ( 1.0 < pp && 1.0 < qq ){
|
||||||
|
r = ( y * y - 3.0 ) / 6.0;
|
||||||
|
s = 1.0 / ( pp + pp - 1.0 );
|
||||||
|
t = 1.0 / ( qq + qq - 1.0 );
|
||||||
|
h = 2.0 / ( s + t );
|
||||||
|
w = y*sqrt(h+r)/h-(t-s)*(r+5.0/6.0-2.0/(3.0*h));
|
||||||
|
value = pp / ( pp + qq * exp ( w + w ) );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
r = qq + qq;
|
||||||
|
t = 1.0 / ( 9.0 * qq );
|
||||||
|
t = r * ( 1.0 - t + y * sqrt ( t )^ 3 );
|
||||||
|
|
||||||
|
if ( t <= 0.0 ){
|
||||||
|
value = 1.0 - exp ( ( ln ( ( 1.0 - a ) * qq ) + beta ) / qq );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
t = ( 4.0 * pp + r - 2.0 ) / t;
|
||||||
|
|
||||||
|
if ( t <= 1.0 ) {
|
||||||
|
value = exp ( ( ln ( a * pp ) + beta ) / pp );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
value = 1.0 - 2.0 / ( t + 1.0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r = 1.0 - pp;
|
||||||
|
t = 1.0 - qq;
|
||||||
|
yprev = 0.0;
|
||||||
|
sq = 1.0;
|
||||||
|
prev = 1.0;
|
||||||
|
|
||||||
|
if ( value < 0.0001 )
|
||||||
|
value = 0.0001;
|
||||||
|
|
||||||
|
if ( 0.9999 < value )
|
||||||
|
value = 0.9999;
|
||||||
|
|
||||||
|
acu = 10^sae;
|
||||||
|
|
||||||
|
for ( ; ; ){
|
||||||
|
y = bround(__CZ__ibetaas63( value, pp, qq, beta),places);
|
||||||
|
xin = value;
|
||||||
|
y = bround(exp(ln(y-a)+(beta+r*ln(xin)+t*ln(1.0- xin ) )),places);
|
||||||
|
|
||||||
|
if ( y * yprev <= 0.0 ) {
|
||||||
|
prev = max ( sq, fpu );
|
||||||
|
}
|
||||||
|
|
||||||
|
g = 1.0;
|
||||||
|
|
||||||
|
for ( ; ; ){
|
||||||
|
for ( ; ; ){
|
||||||
|
adj = g * y;
|
||||||
|
sq = adj * adj;
|
||||||
|
if ( sq < prev ){
|
||||||
|
tx = value - adj;
|
||||||
|
if ( 0.0 <= tx && tx <= 1.0 ) break;
|
||||||
|
}
|
||||||
|
g = g / 3.0;
|
||||||
|
}
|
||||||
|
if ( prev <= acu ){
|
||||||
|
if ( indx )
|
||||||
|
value = 1.0 - value;
|
||||||
|
epsilon(eps);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
if ( y * y <= acu ){
|
||||||
|
if ( indx )
|
||||||
|
value = 1.0 - value;
|
||||||
|
epsilon(eps);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
if ( tx != 0.0 && tx != 1.0 )
|
||||||
|
break;
|
||||||
|
g = g / 3.0;
|
||||||
|
}
|
||||||
|
if ( tx == value ) break;
|
||||||
|
value = tx;
|
||||||
|
yprev = y;
|
||||||
|
}
|
||||||
|
if ( indx )
|
||||||
|
value = 1.0 - value;
|
||||||
|
|
||||||
|
epsilon(eps);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Beta distribution
|
||||||
|
*
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
define betapdf(x,a,b){
|
||||||
|
if(x<0 || x>1) return newerror("betapdf: parameter x out of domain");
|
||||||
|
if(a<=0) return newerror("betapdf: parameter a out of domain");
|
||||||
|
if(b<=0) return newerror("betapdf: parameter b out of domain");
|
||||||
|
|
||||||
|
return 1/beta(a,b) *x^(a-1)*(1-x)^(b-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betacdf(x,a,b){
|
||||||
|
if(x<0 || x>1) return newerror("betacdf: parameter x out of domain");
|
||||||
|
if(a<=0) return newerror("betacdf: parameter a out of domain");
|
||||||
|
if(b<=0) return newerror("betacdf: parameter b out of domain");
|
||||||
|
|
||||||
|
return betainc(x,a,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betacdfinv(x,a,b){
|
||||||
|
return invbetainc(x,a,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betamedian(a,b){
|
||||||
|
local t106 t104 t103 t105 approx ret;
|
||||||
|
if(a == b) return 1/2;
|
||||||
|
if(a == 1 && b > 0) return 1-(1/2)^(1/b);
|
||||||
|
if(a > 0 && b == 1) return (1/2)^(1/a);
|
||||||
|
if(a == 3 && b == 2){
|
||||||
|
/* Yes, the author is not ashamed to ask Maxima for the exact solution
|
||||||
|
of a quartic equation. */
|
||||||
|
t103 = ( (2^(3/2))/27 +4/27 )^(1/3);
|
||||||
|
t104 = sqrt( ( 9*t103^2 + 4*t103 + 2 )/(t103) )/3;
|
||||||
|
t105 = -t103-2/(9*t103) +8/9;
|
||||||
|
t106 = sqrt( (27*t104*t105+16)/(t104) )/(2*3^(3/2));
|
||||||
|
return -t106+t104/2+1/3;
|
||||||
|
}
|
||||||
|
if(a == 2 && b == 3){
|
||||||
|
t103 = ( (2^(3/2))/27 +4/27 )^(1/3);
|
||||||
|
t104 = sqrt( ( 9*t103^2 + 4*t103 + 2 )/(t103) )/3;
|
||||||
|
t105 = -t103-2/(9*t103) +8/9;
|
||||||
|
t106 = sqrt( (27*t104*t105+16)/(t104) )/(2*3^(3/2));
|
||||||
|
return 1-(-t106+t104/2+1/3);
|
||||||
|
}
|
||||||
|
return invbetainc(1/2,a,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betamode(a,b){
|
||||||
|
if(a + b == 2) return newerror("betamod: a + b = 2 = division by zero");
|
||||||
|
return (a-1)/(a+b-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betavariance(a,b){
|
||||||
|
return (a*b)/( (a+b)^2*(a+b+1) );
|
||||||
|
}
|
||||||
|
|
||||||
|
define betalnvariance(a,b){
|
||||||
|
return polygamma(1,a)-polygamma(a+b);
|
||||||
|
}
|
||||||
|
|
||||||
|
define betaskewness(a,b){
|
||||||
|
return (2*(b-a)*sqrt(a+b+1))/( (a+b+1)*sqrt(a*b) );
|
||||||
|
}
|
||||||
|
|
||||||
|
define betakurtosis(a,b){
|
||||||
|
local num denom;
|
||||||
|
|
||||||
|
num = 6*( (a-b)^2*(a+b+1)-a*b*(a+b+2));
|
||||||
|
denom = a*b*(a+b+2)*(a+b+3);
|
||||||
|
return num/denom;
|
||||||
|
}
|
||||||
|
|
||||||
|
define betaentropy(a,b){
|
||||||
|
return lnbeta(a,b)-(a-1)*psi(a)-(b-1)*psi(b)+(a+b+1)*psi(a+b);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Normal (Gaussian) distribution
|
||||||
|
*
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
define normalpdf(x,mu,sigma){
|
||||||
|
return 1/(sqrt(2*pi()*sigma^2))*exp( ( (x-mu)^2 )/( 2*sigma^2 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
define normalcdf(x,mu,sigma){
|
||||||
|
return 1/2*(1+erf( ( x-mu )/( sqrt(2*sigma^2) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
define probit(p){
|
||||||
|
if(p<0 || p > 1) return newerror("probit: p out of domain 0<=p<=1");
|
||||||
|
return sqrt(2)*ervinv(2*p-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
define normalcdfinv(p,mu,sigma){
|
||||||
|
if(p<0 || p > 1) return newerror("normalcdfinv: p out of domain 0<=p<=1");
|
||||||
|
return mu+ sigma*probit(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
define normalmean(mu,sigma){return mu;}
|
||||||
|
|
||||||
|
define normalmedian(mu,sigma){return mu;}
|
||||||
|
|
||||||
|
define normalmode(mu,sigma){return mu;}
|
||||||
|
|
||||||
|
define normalvariance(mu,sigma){return sigma^2;}
|
||||||
|
|
||||||
|
define normalskewness(mu,sigma){return 0;}
|
||||||
|
|
||||||
|
define normalkurtosis(mu,sigma){return 0;}
|
||||||
|
|
||||||
|
define normalentropy(mu,sigma){
|
||||||
|
return 1/3*ln( 2*pi()*exp(1)*sigma^2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* moment generating f. */
|
||||||
|
define normalmgf(mu,sigma,t){
|
||||||
|
return exp(mu*t+1/2*sigma^2*t^2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* characteristic f. */
|
||||||
|
define normalcf(mu,sigma,t){
|
||||||
|
return exp(mu*t-1/2*sigma^2*t^2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Chi-squared distribution
|
||||||
|
*
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
define chisquaredpdf(x,k){
|
||||||
|
if(!isint(k) || k<0) return newerror("chisquaredpdf: k not in N");
|
||||||
|
if(im(x) || x<0) return newerror("chisquaredpdf: x not in +R");
|
||||||
|
/* The gamma function does not check for half integers, do it here? */
|
||||||
|
return 1/(2^(k/2)*gamma(k/2))*x^((k/2)-1)*exp(-x/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
define chisquaredpcdf(x,k){
|
||||||
|
if(!isint(k) || k<0) return newerror("chisquaredcdf: k not in N");
|
||||||
|
if(im(x) || x<0) return newerror("chisquaredcdf: x not in +R");
|
||||||
|
|
||||||
|
return 1/(gamma(k/2))*gammainc(k/2,x/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
define chisquaredmean(x,k){return k;}
|
||||||
|
|
||||||
|
define chisquaredmedian(x,k){
|
||||||
|
/* TODO: implement a FAST inverse incomplete gamma-{q,p} function */
|
||||||
|
return k*(1-2/(9*k))^3;
|
||||||
|
}
|
||||||
|
|
||||||
|
define chisquaredmode(x,k){return max(k-2,0);}
|
||||||
|
define chisquaredvariance(x,k){return 2*k;}
|
||||||
|
define chisquaredskewness(x,k){return sqrt(8/k);}
|
||||||
|
define chisquaredkurtosis(x,k){return 12/k;}
|
||||||
|
define chisquaredentropy(x,k){
|
||||||
|
return k/2+ln(2*gamma(k/2)) + (1-k/2)*psi(k/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
define chisquaredmfg(k,t){
|
||||||
|
if(t>=1/2)return newerror("chisquaredmfg: t >= 1/2");
|
||||||
|
return (1-2*t)^(k/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
define chisquaredcf(k,t){
|
||||||
|
return (1-2*1i*t)^(k/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "gammaincoctave(z,a)";
|
||||||
|
print "invbetainc(x,a,b)";
|
||||||
|
print "betapdf(x,a,b)";
|
||||||
|
print "betacdf(x,a,b)";
|
||||||
|
print "betacdfinv(x,a,b)";
|
||||||
|
print "betamedian(a,b)";
|
||||||
|
print "betamode(a,b)";
|
||||||
|
print "betavariance(a,b)";
|
||||||
|
print "betalnvariance(a,b)";
|
||||||
|
print "betaskewness(a,b)";
|
||||||
|
print "betakurtosis(a,b)";
|
||||||
|
print "betaentropy(a,b)";
|
||||||
|
print "normalpdf(x,mu,sigma)";
|
||||||
|
print "normalcdf(x,mu,sigma)";
|
||||||
|
print "probit(p)";
|
||||||
|
print "normalcdfinv(p,mu,sigma)";
|
||||||
|
print "normalmean(mu,sigma)";
|
||||||
|
print "normalmedian(mu,sigma)";
|
||||||
|
print "normalmode(mu,sigma)";
|
||||||
|
print "normalvariance(mu,sigma)";
|
||||||
|
print "normalskewness(mu,sigma)";
|
||||||
|
print "normalkurtosis(mu,sigma)";
|
||||||
|
print "normalentropy(mu,sigma)";
|
||||||
|
print "normalmgf(mu,sigma,t)";
|
||||||
|
print "normalcf(mu,sigma,t)";
|
||||||
|
print "chisquaredpdf(x,k)";
|
||||||
|
print "chisquaredpcdf(x,k)";
|
||||||
|
print "chisquaredmean(x,k)";
|
||||||
|
print "chisquaredmedian(x,k)";
|
||||||
|
print "chisquaredmode(x,k)";
|
||||||
|
print "chisquaredvariance(x,k)";
|
||||||
|
print "chisquaredskewness(x,k)";
|
||||||
|
print "chisquaredkurtosis(x,k)";
|
||||||
|
print "chisquaredentropy(x,k)";
|
||||||
|
print "chisquaredmfg(k,t)";
|
||||||
|
print "chisquaredcf(k,t)";
|
||||||
|
}
|
||||||
|
|
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: test2600.cal,v 30.2 2007/07/11 22:57:23 chongo Exp $
|
* @(#) $Id: test2600.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test2600.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test2600.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/10/13 00:13:14
|
* Under source code control: 1995/10/13 00:13:14
|
||||||
@@ -91,7 +91,8 @@ define testismult(str, n, verbose)
|
|||||||
if (!ismult(c,a)) {
|
if (!ismult(c,a)) {
|
||||||
m++;
|
m++;
|
||||||
if (verbose > 1) {
|
if (verbose > 1) {
|
||||||
printf("*** Failure with:\na = %d\nb = %d\n", a,b);
|
printf("*** Failure with:\na = %d\nb = %d\n",
|
||||||
|
a,b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,7 +134,8 @@ define testsqrt(str, n, eps, verbose)
|
|||||||
if (abs(c) > 1) {
|
if (abs(c) > 1) {
|
||||||
m++;
|
m++;
|
||||||
if (verbose > 1) {
|
if (verbose > 1) {
|
||||||
printf("*** Failure with:\na = %d\neps = %d\n", a,eps);
|
printf("*** Failure with:\na = %d\neps = %d\n",
|
||||||
|
a,eps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +180,8 @@ define testexp(str, n, eps, verbose)
|
|||||||
if (abs(c) > 0.02) {
|
if (abs(c) > 0.02) {
|
||||||
m++;
|
m++;
|
||||||
if (verbose > 1) {
|
if (verbose > 1) {
|
||||||
printf("*** Failure with:\na = %d\neps = %d\n", a,eps);
|
printf("*** Failure with:\na = %d\neps = %d\n",
|
||||||
|
a,eps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,7 +238,8 @@ define testln(str, n, eps, verbose)
|
|||||||
if (abs(c) > 0.5) {
|
if (abs(c) > 0.5) {
|
||||||
m++;
|
m++;
|
||||||
if (verbose > 1) {
|
if (verbose > 1) {
|
||||||
printf("*** Failure with:\na = %d\neps = %d\n", a,eps);
|
printf("*** Failure with:\na = %d\neps = %d\n",
|
||||||
|
a,eps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: test2700.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
|
* @(#) $Id: test2700.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test2700.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test2700.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/11/01 22:52:25
|
* Under source code control: 1995/11/01 22:52:25
|
||||||
@@ -127,7 +127,8 @@ define testcsqrt(str, n, verbose)
|
|||||||
if (p) {
|
if (p) {
|
||||||
if (verbose > 0)
|
if (verbose > 0)
|
||||||
printf(
|
printf(
|
||||||
"*** Type %d failure for x = %r, y = %r, z = %d\n",
|
"*** Type %d failure for x = %r, "
|
||||||
|
"y = %r, z = %d\n",
|
||||||
p, x, y, z);
|
p, x, y, z);
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: test4000.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
|
* @(#) $Id: test4000.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test4000.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test4000.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1996/03/13 02:38:45
|
* Under source code control: 1996/03/13 02:38:45
|
||||||
@@ -199,7 +199,8 @@ define ctimes(str, N, n, count, skip, verbose)
|
|||||||
p = ptest(A[i], count, skip);
|
p = ptest(A[i], count, skip);
|
||||||
if (p) {
|
if (p) {
|
||||||
if (verbose > 0) {
|
if (verbose > 0) {
|
||||||
printf("*** Error, what should be rare has occurred for x = %d \n", A[i]);
|
printf("*** Error, what should be rare "
|
||||||
|
"has occurred for x = %d \n", A[i]);
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,7 +307,8 @@ define ntimes(str, N, n, count, skip, residue, modulus, verbose)
|
|||||||
}
|
}
|
||||||
tprev = round(usertime() - t, 4);
|
tprev = round(usertime() - t, 4);
|
||||||
if (verbose > 0) {
|
if (verbose > 0) {
|
||||||
printf("%d evaluations, nextcand: %d, prevcand: %d\n", n, tnext, tprev);
|
printf("%d evaluations, nextcand: %d, "
|
||||||
|
"prevcand: %d\n", n, tnext, tprev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: test8500.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
|
* @(#) $Id: test8500.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test8500.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test8500.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1999/11/12 20:59:59
|
* Under source code control: 1999/11/12 20:59:59
|
||||||
@@ -134,8 +134,8 @@ define onetest_8500(a,b,rnd) {
|
|||||||
* The rounding parameter is randomly chosen.
|
* The rounding parameter is randomly chosen.
|
||||||
*
|
*
|
||||||
* After a run of divmod_8500 the a, b, rnd values which gave failure are
|
* After a run of divmod_8500 the a, b, rnd values which gave failure are
|
||||||
* stored in the list L_8500. L_8500[0], L_8500[1], L_8500[2] are a, b, rnd for the first
|
* stored in the list L_8500. L_8500[0], L_8500[1], L_8500[2] are a, b,
|
||||||
* test, etc.
|
* rnd for the first* test, etc.
|
||||||
*/
|
*/
|
||||||
define divmod_8500(N = 10, M1 = 2^128, M2 = 2^64, testnum = 0)
|
define divmod_8500(N = 10, M1 = 2^128, M2 = 2^64, testnum = 0)
|
||||||
{
|
{
|
||||||
|
3120
cal/test8900.cal
Normal file
3120
cal/test8900.cal
Normal file
File diff suppressed because it is too large
Load Diff
362
cal/toomcook.cal
Normal file
362
cal/toomcook.cal
Normal file
@@ -0,0 +1,362 @@
|
|||||||
|
/*
|
||||||
|
* toomcook - implementation of Toom-Cook(3,4) multiplication algorithm
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Christoph Zurnieden
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: toomcook.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/toomcook.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hide internal function from resource debugging
|
||||||
|
*/
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
/* */
|
||||||
|
define toomcook3(a,b){
|
||||||
|
local alen blen a0 a1 a2 b0 b1 b2 m ret sign mask;
|
||||||
|
local S0 S1 S2 S3 S4 T1 T2;
|
||||||
|
|
||||||
|
if(!isint(a) || !isint(b))
|
||||||
|
return newerror("toomcook3(a,b): a and/or b is not an integer");
|
||||||
|
|
||||||
|
alen = digits(a,2);
|
||||||
|
blen = digits(b,2);
|
||||||
|
|
||||||
|
sign = sgn(a) * sgn(b);
|
||||||
|
/* sgn(x) returns 0 if x = 0 */
|
||||||
|
if(sign == 0) return 0;
|
||||||
|
|
||||||
|
m = min(alen,blen)//3;
|
||||||
|
mask = ~-(1<<m);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Cut-off at about 4,000 dec. digits
|
||||||
|
TODO: check
|
||||||
|
*/
|
||||||
|
if(isdefined("test8900")){
|
||||||
|
if(m < 20) return a*b;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(m < 4096 ) return a*b;
|
||||||
|
}
|
||||||
|
a = abs(a);
|
||||||
|
b = abs(b);
|
||||||
|
|
||||||
|
a0 = a & mask;
|
||||||
|
a1 = (a>>m) & mask;
|
||||||
|
a2 = (a>>(2*m));
|
||||||
|
|
||||||
|
b0 = b & mask;
|
||||||
|
b1 = (b>>m) & mask;
|
||||||
|
b2 = (b>>(2*m));
|
||||||
|
|
||||||
|
/*
|
||||||
|
Zimmermann
|
||||||
|
*/
|
||||||
|
|
||||||
|
S0 = toomcook3(a0 , b0);
|
||||||
|
S1 = toomcook3((a2+a1+a0) , (b2+b1+b0));
|
||||||
|
S2 = toomcook3(((a2<<2)+(a1<<1)+a0) , ((b2<<2)+(b1<<1)+b0));
|
||||||
|
S3 = toomcook3((a2-a1+a0) , (b2-b1+b0));
|
||||||
|
S4 = toomcook3(a2,b2);
|
||||||
|
T1 = (S3<<1) + S2;
|
||||||
|
T1 /= 3;
|
||||||
|
T1 += S0;
|
||||||
|
T1 >>= 1;
|
||||||
|
T1 -= S4<<1;
|
||||||
|
T2 = (S1 + S3)>>1;
|
||||||
|
S1 -= T1;
|
||||||
|
S2 = T2 - S0 - S4;
|
||||||
|
S3 = T1 - T2;
|
||||||
|
|
||||||
|
ret = (S4<<(4*m)) + (S3<<(3*m)) + (S2<<(2*m)) + (S1<<(1*m)) + S0;
|
||||||
|
|
||||||
|
|
||||||
|
ret = sign *ret;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
define toomcook3square(a){
|
||||||
|
local alen a0 a1 a2 m tmp tmp2 ret sign S0 S1 S2 S3 S4 T1 mask;
|
||||||
|
|
||||||
|
if(!isint(a))return newerror("toomcook3square(a): a is not integer");
|
||||||
|
|
||||||
|
alen = digits(a,2);
|
||||||
|
|
||||||
|
sign = sgn(a) * sgn(a);
|
||||||
|
if(sign == 0) return 0;
|
||||||
|
|
||||||
|
m = alen//3;
|
||||||
|
mask = ~-(1<<m);
|
||||||
|
/*
|
||||||
|
Cut-off at about 5,000 dec. digits
|
||||||
|
TODO: check
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(isdefined("test8900")){
|
||||||
|
if(m < 20) return a^2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(m < 5000 ) return a^2;
|
||||||
|
}
|
||||||
|
|
||||||
|
a = abs(a);
|
||||||
|
|
||||||
|
a0 = a & mask;
|
||||||
|
a1 = (a>>m) & mask;
|
||||||
|
a2 = (a>>(2*m));
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bodrato/Zanoni
|
||||||
|
*/
|
||||||
|
S0 = toomcook3square(a0);
|
||||||
|
S1 = toomcook3square(a2+a1+a0);
|
||||||
|
S2 = toomcook3square(a2-a1+a0);
|
||||||
|
S3 = toomcook3(a1<<1,a2);
|
||||||
|
S4 = toomcook3square(a2);
|
||||||
|
|
||||||
|
T1 = (S1 + S2)>>1;
|
||||||
|
S1 = S1 - T1 - S3;
|
||||||
|
S2 = T1 - S4 -S0;
|
||||||
|
|
||||||
|
|
||||||
|
S1 = S1<<(1*m);
|
||||||
|
S2 = S2<<(2*m);
|
||||||
|
S3 = S3<<(3*m);
|
||||||
|
S4 = S4<<(4*m);
|
||||||
|
|
||||||
|
ret = S0 + S1 + S2 + S3 + S4;
|
||||||
|
ret = sign *ret;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
define toomcook4(a,b)
|
||||||
|
{
|
||||||
|
|
||||||
|
local a0 a1 a2 a3 b0 b1 b2 b3 b4 ret tmp tmp2 tmp3 sign;
|
||||||
|
local m alen blen mask;
|
||||||
|
local w1, w2, w3, w4, w5, w6, w7;
|
||||||
|
|
||||||
|
if(!isint(a) || !isint(b))
|
||||||
|
return newerror("toomcook4(a,b): a and/or b is not integer");
|
||||||
|
|
||||||
|
alen = digits(a,2);
|
||||||
|
blen = digits(b,2);
|
||||||
|
|
||||||
|
sign = sgn(a) * sgn(b);
|
||||||
|
|
||||||
|
if(sign == 0) return 0;
|
||||||
|
|
||||||
|
m = min(alen//4,blen//4);
|
||||||
|
mask = ~-(1<<m);
|
||||||
|
|
||||||
|
if(isdefined("test8900")){
|
||||||
|
if(m < 100) return toomcook3(a,b);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(m < 256*3072) return toomcook3(a,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
a = abs(a);
|
||||||
|
b = abs(b);
|
||||||
|
|
||||||
|
|
||||||
|
a0 = a & mask;
|
||||||
|
a1 = (a>>m) & mask;
|
||||||
|
a2 = (a>>(2*m)) & mask;
|
||||||
|
a3 = (a>>(3*m));
|
||||||
|
|
||||||
|
b0 = b & mask;
|
||||||
|
b1 = (b>>m) & mask;
|
||||||
|
b2 = (b>>(2*m)) & mask;
|
||||||
|
b3 = (b>>(3*m));
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bodrato / Zanoni
|
||||||
|
*/
|
||||||
|
|
||||||
|
w3 = a3 + (a1 + (a2 + a0));
|
||||||
|
w7 = b3 + (b1 + (b2 + b0));
|
||||||
|
|
||||||
|
w4 = -a3 + (-a1 + (a2 + a0));
|
||||||
|
w5 = -b3 + (-b1 + (b2 + b0));
|
||||||
|
|
||||||
|
w3 = toomcook4(w3, w7);
|
||||||
|
w4 = toomcook4(w4, w5);
|
||||||
|
|
||||||
|
w5 = a3 + ((a1<<2) + ((a2<<1) + (a0<<3)));
|
||||||
|
w2 = b3 + ((b1<<2) + ((b2<<1) + (b0<<3)));
|
||||||
|
|
||||||
|
w6 = -a3 + (-(a1<<2) + ((a2<<1) + (a0<<3)));
|
||||||
|
w7 = -b3 + (-(b1<<2) + ((b2<<1) + (b0<<3)));
|
||||||
|
|
||||||
|
w5 = toomcook4(w5, w2);
|
||||||
|
w6 = toomcook4(w6, w7);
|
||||||
|
|
||||||
|
|
||||||
|
w2 = (a3<<3) + ((a1<<1) + ((a2<<2) + a0));
|
||||||
|
w7 = (b3<<3) + ((b1<<1) + ((b2<<2) + b0));
|
||||||
|
|
||||||
|
|
||||||
|
w2 = toomcook4(w2, w7);
|
||||||
|
|
||||||
|
w1 = toomcook4(a3, b3);
|
||||||
|
w7 = toomcook4(a0, b0);
|
||||||
|
|
||||||
|
w2 = w2 + w5;
|
||||||
|
w6 = w5 - w6;
|
||||||
|
w4 = w3 - w4;
|
||||||
|
w5 = w5 - w1;
|
||||||
|
w5 -= w7 << 6;
|
||||||
|
w4 = w4>>1;
|
||||||
|
w3 = w3 - w4;
|
||||||
|
w5 = w5<<1;
|
||||||
|
w5 = w5 - w6;
|
||||||
|
w2 -= w3 * 65;
|
||||||
|
w3 = w3 - w7;
|
||||||
|
w3 = w3 - w1;
|
||||||
|
w2 += w3 * 45;
|
||||||
|
w5 -= w3<<3;
|
||||||
|
w5 = w5//24;
|
||||||
|
w6 = w6 - w2;
|
||||||
|
w2 -= w4<<4;
|
||||||
|
w2 = w2//18;
|
||||||
|
w3 = w3 - w5;
|
||||||
|
w4 = w4 - w2;
|
||||||
|
w6 += w2 * 30;
|
||||||
|
w6 = w6//60;
|
||||||
|
w2 = w2 - w6;
|
||||||
|
|
||||||
|
|
||||||
|
ret = w7 + (w6<<m) + (w5<<(2*m)) + (w4<<(3*m))+ (w3<<(4*m))+
|
||||||
|
(w2<<(5*m))+ (w1<<(6*m));
|
||||||
|
|
||||||
|
ret = sign *ret;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
define toomcook4square(a){
|
||||||
|
local a0 a1 a2 a3 ret S0 S1 S2 S3 S4 S5 S6 S7 tmp tmp2 tmp3;
|
||||||
|
local sign m alen mask;
|
||||||
|
local T0 T1 T2 T3 T4 T5 T6 T7 T8;
|
||||||
|
|
||||||
|
if(!isint(a) )return newerror("toomcook3square(a): a is not integer");
|
||||||
|
|
||||||
|
alen = digits(a,2);
|
||||||
|
|
||||||
|
sign = sgn(a) * sgn(a);
|
||||||
|
/* sgn(x) returns 0 if x = 0 */
|
||||||
|
if(sign == 0) return 0;
|
||||||
|
|
||||||
|
m = (alen)//4;
|
||||||
|
mask = ~-( 1 << m );
|
||||||
|
|
||||||
|
/*
|
||||||
|
cut-off at about 2 mio. dec. digits
|
||||||
|
TODO: check!
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(isdefined("test8900")){
|
||||||
|
if(m < 100) return toomcook3square(a);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(m < 512*3072) return toomcook3square(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
a = abs(a);
|
||||||
|
|
||||||
|
a0 = a & mask;
|
||||||
|
a1 = (a>>m) & mask;
|
||||||
|
a2 = (a>>(2*m)) & mask;
|
||||||
|
a3 = (a>>(3*m)) ;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bodrato / Zanoni
|
||||||
|
*/
|
||||||
|
|
||||||
|
S1 = toomcook4square(a0);
|
||||||
|
S2 = toomcook4(a0<<1,a1);
|
||||||
|
S3 = toomcook4((a0 + a1 - a2 - a3 ) , (a0 - a1 - a2 + a3 ));
|
||||||
|
S4 = toomcook4square(a0 + a1 + a2 + a3 );
|
||||||
|
S5 = toomcook4( (a0 - a2 )<<1 , (a1 - a3 ));
|
||||||
|
S6 = toomcook4(a3<<1 , a2);
|
||||||
|
S7 = toomcook4square(a3);
|
||||||
|
|
||||||
|
T1 = S3 + S4;
|
||||||
|
T2 = (T1 + S5 )>>1;
|
||||||
|
T3 = S2 + S6;
|
||||||
|
T4 = T2 - T3;
|
||||||
|
T5 = T3 - S5;
|
||||||
|
T6 = T4 - S3;
|
||||||
|
T7 = T4 - S1;
|
||||||
|
T8 = T6 - S7;
|
||||||
|
|
||||||
|
ret = (S7<<(6*m)) + (S6<<(5*m)) + (T7<<(4*m))
|
||||||
|
+ (T5<<(3*m)) + (T8<<(2*m)) + (S2<<(1*m)) + S1;
|
||||||
|
|
||||||
|
ret = sign *ret;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: Implement the asymmetric variations
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
produce_long_random_number(n) returns large pseudorandom numbers. Really large
|
||||||
|
numbers, e.g.:
|
||||||
|
produce_long_random_number(16)
|
||||||
|
is ca 4,128,561 bits (ca 1,242,821 dec. digits) large. Exact length is not
|
||||||
|
predeterminable because of the chaotic output of the function random().
|
||||||
|
*/
|
||||||
|
define __CZ__produce_long_random_number(n)
|
||||||
|
{
|
||||||
|
local ret k;
|
||||||
|
ret = 1;
|
||||||
|
if(!isint(n) || n<1)
|
||||||
|
return newerror("__CZ__produce_long_random_number(n): "
|
||||||
|
"n is not an integer >=1");
|
||||||
|
for(k=0;k<n;k++){
|
||||||
|
ret += random();
|
||||||
|
ret = toomcook4square(ret);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
* report important interface functions
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "toomcook3(a,b)";
|
||||||
|
print "toomcook3square(a)";
|
||||||
|
print "toomcook4(a,b)";
|
||||||
|
print "toomcook4square(a)";
|
||||||
|
}
|
116
cal/zeta2.cal
Normal file
116
cal/zeta2.cal
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* zeta2 - Hurwitz Zeta function
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 30.4 $
|
||||||
|
* @(#) $Id: zeta2.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/zeta2.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2013/08/11 01:31:28
|
||||||
|
* File existed as early as: 2013
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hide internal function from resource debugging
|
||||||
|
*/
|
||||||
|
static resource_debug_level;
|
||||||
|
resource_debug_level = config("resource_debug", 0);
|
||||||
|
|
||||||
|
|
||||||
|
define hurwitzzeta(s,a){
|
||||||
|
local realpart_a imagpart_s tmp tmp1 tmp2 tmp3;
|
||||||
|
local sum1 sum2 sum3 i k n precision result limit;
|
||||||
|
local limit_function offset offset_squared rest_sum eps;
|
||||||
|
/*
|
||||||
|
According to Linas Vepstas' "An efficient algorithm for accelerating
|
||||||
|
the convergence of oscillatory series, useful for computing the
|
||||||
|
polylogarithm and Hurwitz zeta functions" the Euler-Maclaurin series
|
||||||
|
is the fastest in most cases.
|
||||||
|
|
||||||
|
With a lot of help of the PARI/GP implementation by Prof. Henri Cohen,
|
||||||
|
hence the different license.
|
||||||
|
*/
|
||||||
|
eps=epsilon( epsilon() * 1e-3);
|
||||||
|
realpart_a=re(a);
|
||||||
|
if(realpart_a>1.5){
|
||||||
|
tmp=floor(realpart_a-0.5);
|
||||||
|
sum1 = 0;
|
||||||
|
for( i = 1 ; i <= tmp ; i++){
|
||||||
|
sum1 += ( a - i )^( -s );
|
||||||
|
}
|
||||||
|
epsilon(eps);
|
||||||
|
return (hurwitzzeta(s,a-tmp)-sum1);
|
||||||
|
}
|
||||||
|
if(realpart_a<=0){
|
||||||
|
tmp=ceil(-realpart_a+0.5);
|
||||||
|
for( i = 0 ; i <= tmp-1 ; i++){
|
||||||
|
sum2 += ( a + i )^( -s );
|
||||||
|
}
|
||||||
|
epsilon(eps);
|
||||||
|
return (hurwitzzeta(s,a+tmp)+sum2);
|
||||||
|
}
|
||||||
|
precision=digits(1/epsilon());
|
||||||
|
realpart_a=re(s);
|
||||||
|
imagpart_s=im(s);
|
||||||
|
epsilon(1e-9);
|
||||||
|
result=s-1.;
|
||||||
|
if(abs(result)<0.1){
|
||||||
|
result=-1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result=ln(result);
|
||||||
|
limit=(precision*ln(10)-re((s-.5)*result)+(1.*realpart_a)*ln(2.*pi()))/2;
|
||||||
|
limit=max(2,ceil(max(limit,abs(s*1.)/2)));
|
||||||
|
limit_function=ceil(sqrt((limit+realpart_a/2-.25)^2+(imagpart_s*1.)^2/4)/
|
||||||
|
pi());
|
||||||
|
if (config("user_debug") > 0) {
|
||||||
|
print "limit_function = " limit_function;
|
||||||
|
print "limit = " limit;
|
||||||
|
print "prec = " precision;
|
||||||
|
}
|
||||||
|
/* Full precison plus 5 digits angstzuschlag*/
|
||||||
|
epsilon( (10^(-precision)) * 1e-5);
|
||||||
|
tmp3=(a+limit_function+0.)^(-s);
|
||||||
|
sum3 = tmp3/2;
|
||||||
|
for(n=0;n<=limit_function-1;n++){
|
||||||
|
sum3 += (a+n)^(-s);
|
||||||
|
}
|
||||||
|
result=sum3;
|
||||||
|
offset=a+limit_function;
|
||||||
|
offset_squared=1./(offset*offset);
|
||||||
|
tmp1=2*s-1;
|
||||||
|
tmp2=s*(s-1);
|
||||||
|
rest_sum=bernoulli(2*limit);
|
||||||
|
for(k=2*limit-2;k>=2;k-=2){
|
||||||
|
rest_sum=bernoulli(k)+offset_squared*
|
||||||
|
(k*k+tmp1*k+tmp2)*rest_sum/((k+1)*(k+2));
|
||||||
|
}
|
||||||
|
rest_sum=offset*(1+offset_squared*tmp2*rest_sum/2);
|
||||||
|
result+=rest_sum*tmp3/(s-1);
|
||||||
|
epsilon(eps);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* restore internal function from resource debugging
|
||||||
|
* report important interface functions
|
||||||
|
*/
|
||||||
|
config("resource_debug", resource_debug_level),;
|
||||||
|
if (config("resource_debug") & 3) {
|
||||||
|
print "hurwitzzeta(s,a)";
|
||||||
|
}
|
10
calc.h
10
calc.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.4 $
|
||||||
* @(#) $Id: calc.h,v 30.2 2007/07/10 17:44:52 chongo Exp $
|
* @(#) $Id: calc.h,v 30.4 2013/09/01 22:16:21 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:31
|
* Under source code control: 1990/02/15 01:48:31
|
||||||
@@ -140,7 +140,8 @@ E_FUNC int ftellid(FILEID id, ZVALUE *res);
|
|||||||
E_FUNC int fseekid(FILEID id, ZVALUE offset, int whence);
|
E_FUNC int fseekid(FILEID id, ZVALUE offset, int whence);
|
||||||
E_FUNC int isattyid(FILEID id);
|
E_FUNC int isattyid(FILEID id);
|
||||||
E_FUNC int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res);
|
E_FUNC int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res);
|
||||||
E_FUNC int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last, ZVALUE *res);
|
E_FUNC int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last,
|
||||||
|
ZVALUE *res);
|
||||||
E_FUNC void showconstants(void);
|
E_FUNC void showconstants(void);
|
||||||
E_FUNC void freeconstant(unsigned long);
|
E_FUNC void freeconstant(unsigned long);
|
||||||
E_FUNC void freestringconstant(long);
|
E_FUNC void freestringconstant(long);
|
||||||
@@ -151,7 +152,8 @@ E_FUNC void trimconstants(void);
|
|||||||
*/
|
*/
|
||||||
E_FUNC int openstring(char *str, size_t num);
|
E_FUNC int openstring(char *str, size_t num);
|
||||||
E_FUNC int openterminal(void);
|
E_FUNC int openterminal(void);
|
||||||
E_FUNC int opensearchfile(char *name, char *pathlist, char *exten, int reopen_ok);
|
E_FUNC int opensearchfile(char *name, char *pathlist, char *exten,
|
||||||
|
int reopen_ok);
|
||||||
E_FUNC char *nextline(void);
|
E_FUNC char *nextline(void);
|
||||||
E_FUNC int nextchar(void);
|
E_FUNC int nextchar(void);
|
||||||
E_FUNC void reread(void);
|
E_FUNC void reread(void);
|
||||||
|
12
calc.man
12
calc.man
@@ -15,8 +15,8 @@
|
|||||||
.\" received a copy with calc; if not, write to Free Software Foundation, Inc.
|
.\" received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#) $Revision: 30.3 $
|
.\" @(#) $Revision: 30.5 $
|
||||||
.\" @(#) $Id: calc.man,v 30.3 2007/09/08 02:53:09 chongo Exp $
|
.\" @(#) $Id: calc.man,v 30.5 2013/08/11 08:41:38 chongo Exp $
|
||||||
.\" @(#) $Source: /usr/local/src/bin/calc/RCS/calc.man,v $
|
.\" @(#) $Source: /usr/local/src/bin/calc/RCS/calc.man,v $
|
||||||
.\"
|
.\"
|
||||||
.\" Under source code control: 1991/07/23 05:48:26
|
.\" Under source code control: 1991/07/23 05:48:26
|
||||||
@@ -1164,8 +1164,10 @@ Send bug reports and bug fixes to:
|
|||||||
.nf
|
.nf
|
||||||
calc-bugs at asthe dot com
|
calc-bugs at asthe dot com
|
||||||
|
|
||||||
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
|
[[ NOTE: Replace 'at' with @, 'dot' is with . ]]
|
||||||
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
|
[[ and remove the spaces ]]
|
||||||
|
[[ NOTE: The EMail address uses 'asthe' and
|
||||||
|
[[ the web site URL uses 'isthe' ]]
|
||||||
.fi
|
.fi
|
||||||
.in -0.5i
|
.in -0.5i
|
||||||
.sp
|
.sp
|
||||||
@@ -1196,7 +1198,7 @@ for more information about bug reporting.
|
|||||||
.SH "CALC WEB SITE"
|
.SH "CALC WEB SITE"
|
||||||
\&
|
\&
|
||||||
.br
|
.br
|
||||||
Landon Noll maintains the the
|
Landon Noll maintains the
|
||||||
.B calc
|
.B calc
|
||||||
web site is located at:
|
web site is located at:
|
||||||
.sp
|
.sp
|
||||||
|
61
calc.spec.in
61
calc.spec.in
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.8 $
|
# @(#) $Revision: 30.11 $
|
||||||
# @(#) $Id: calc.spec.in,v 30.8 2013/05/01 16:23:39 chongo Exp chongo $
|
# @(#) $Id: calc.spec.in,v 30.11 2013/08/11 08:41:38 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/calc.spec.in,v $
|
# @(#) $Source: /usr/local/src/bin/calc/RCS/calc.spec.in,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 2003/02/16 20:21:39
|
# Under source code control: 2003/02/16 20:21:39
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
Summary: Arbitrary precision calculator.
|
Summary: Arbitrary precision calculator.
|
||||||
Name: calc
|
Name: calc
|
||||||
Version: <<<PROJECT_VERSION>>>
|
Version: <<<PROJECT_VERSION>>>
|
||||||
Release: 2.1
|
Release: 10
|
||||||
License: LGPL
|
License: LGPL
|
||||||
Group: Applications/Engineering
|
Group: Applications/Engineering
|
||||||
Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2
|
Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2
|
||||||
@@ -76,38 +76,59 @@ For the latest calc release, see the project home page:
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
echo '-=- calc.spec beginning make clobber -=-'
|
echo '-=- calc.spec beginning make clobber -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
||||||
echo '-=- calc.spec ending make clobber -=-'
|
echo '-=- calc.spec ending make clobber -=-'
|
||||||
echo '-=- calc.spec beginning make calc-static-only -=-'
|
echo '-=- calc.spec beginning make calc-static-only -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only
|
||||||
echo '-=- calc.spec ending make calc-static-only -=-'
|
echo '-=- calc.spec ending make calc-static-only -=-'
|
||||||
echo '-=- calc.spec beginning make rpm-hide-static -=-'
|
echo '-=- calc.spec beginning make rpm-hide-static -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static
|
||||||
echo '-=- calc.spec ending make rpm-hide-static -=-'
|
echo '-=- calc.spec ending make rpm-hide-static -=-'
|
||||||
echo '-=- calc.spec beginning make clobber (again) -=-'
|
echo '-=- calc.spec beginning make clobber (again) -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
||||||
echo '-=- calc.spec ending make clobber (again) -=-'
|
echo '-=- calc.spec ending make clobber (again) -=-'
|
||||||
echo '-=- calc.spec beginning make calc-dynamic-only -=-'
|
echo '-=- calc.spec beginning make calc-dynamic-only -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only BLD_TYPE=calc-dynamic-only LD_SHARE=
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only \
|
||||||
|
BLD_TYPE=calc-dynamic-only LD_SHARE=
|
||||||
echo '-=- calc.spec ending make calc-dynamic-only -=-'
|
echo '-=- calc.spec ending make calc-dynamic-only -=-'
|
||||||
echo '-=- calc.spec beginning make chk -=-'
|
echo '-=- calc.spec beginning make chk -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ chk
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ chk
|
||||||
echo '-=- calc.spec ending make chk -=-'
|
echo '-=- calc.spec ending make chk -=-'
|
||||||
echo '-=- calc.spec beginning make rpm-unhide-static -=-'
|
echo '-=- calc.spec beginning make rpm-unhide-static -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static
|
||||||
echo '-=- calc.spec ending make rpm-unhide-static -=-'
|
echo '-=- calc.spec ending make rpm-unhide-static -=-'
|
||||||
echo '-=- calc.spec beginning make rpm-clean-static -=-'
|
echo '-=- calc.spec beginning make rpm-clean-static -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static
|
||||||
echo '-=- calc.spec ending make rpm-clean-static -=-'
|
echo '-=- calc.spec ending make rpm-clean-static -=-'
|
||||||
echo '-=- calc.spec beginning make rpm-chk-static -=-'
|
echo '-=- calc.spec beginning make rpm-chk-static -=-'
|
||||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static
|
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static
|
||||||
echo '-=- calc.spec ending make rpm-chk-static -=-'
|
echo '-=- calc.spec ending make rpm-chk-static -=-'
|
||||||
|
|
||||||
%install
|
%install
|
||||||
echo '-=- calc.spec beginning make install -=-'
|
echo '-=- calc.spec beginning make install -=-'
|
||||||
rm -rf %{_buildroot}
|
rm -rf %{_buildroot}
|
||||||
mkdir -p %{_buildroot}
|
mkdir -p %{_buildroot}
|
||||||
make T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ install
|
make T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||||
|
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||||
|
MANDIR=%{_mandir}/man1 EXT= V=@ install
|
||||||
echo '-=- calc.spec ending make install -=-'
|
echo '-=- calc.spec ending make install -=-'
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@@ -141,36 +162,48 @@ rm -rf %{_buildroot}
|
|||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo
|
* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 10
|
||||||
|
- Major bug rpm build process bug fix
|
||||||
- Source: is a URL as per rpm requirements
|
- Source: is a URL as per rpm requirements
|
||||||
- Release: 2.1
|
|
||||||
- Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358
|
- Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358
|
||||||
- BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3
|
- BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3
|
||||||
|
- BuildRoot: %{_tmppath}/build-root
|
||||||
|
- Fixed use of %{_buildroot}
|
||||||
- Fixed permissions so that rpm build services can modify libraries
|
- Fixed permissions so that rpm build services can modify libraries
|
||||||
- Added missing files to files section
|
- Added missing files to files section
|
||||||
* Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo
|
* Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 9 (was 1.1)
|
||||||
- Removed deprecated PreReq for calc-devel, using Requires
|
- Removed deprecated PreReq for calc-devel, using Requires
|
||||||
* Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
|
* Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 8
|
||||||
- Release of calc-2.12.2
|
- Release of calc-2.12.2
|
||||||
- Calc builds with shared libraries
|
- Calc builds with shared libraries
|
||||||
* Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo
|
* Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 7
|
||||||
- Changed Copyright to License as per new rpm v4.4 syntax
|
- Changed Copyright to License as per new rpm v4.4 syntax
|
||||||
* Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
|
* Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 6
|
||||||
- Release of calc-2.12.0
|
- Release of calc-2.12.0
|
||||||
- Added *.line set files to the list of packaged files
|
- Added *.line set files to the list of packaged files
|
||||||
* Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo
|
* Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 5
|
||||||
- Release of calc-2.11.11
|
- Release of calc-2.11.11
|
||||||
- Fixed description in spec file
|
- Fixed description in spec file
|
||||||
* Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo
|
* Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 4
|
||||||
- Release of calc-2.11.7-2
|
- Release of calc-2.11.7-2
|
||||||
- Fixed attributes on include and lib calc-devel files
|
- Fixed attributes on include and lib calc-devel files
|
||||||
- Added BUGS to calc-devel as well as calc
|
- Added BUGS to calc-devel as well as calc
|
||||||
* Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo
|
* Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 3
|
||||||
- Release of calc-2.11.7-1
|
- Release of calc-2.11.7-1
|
||||||
- Require ncurses, readline and less to install.
|
- Require ncurses, readline and less to install.
|
||||||
- Require ncurses-devel and readline-devel to build.
|
- Require ncurses-devel and readline-devel to build.
|
||||||
* Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo
|
* Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||||
|
- Release: 2
|
||||||
- Misc changes to fit local directory setup
|
- Misc changes to fit local directory setup
|
||||||
* Sun Feb 16 2003 Petteri Kettunen <petterik@users.sourceforge.net>
|
* Sun Feb 16 2003 Petteri Kettunen <petterik@users.sourceforge.net>
|
||||||
|
- Release: 1
|
||||||
- initial RPM build
|
- initial RPM build
|
||||||
|
|
||||||
#****
|
#****
|
||||||
|
28
calcerr.tbl
28
calcerr.tbl
@@ -17,8 +17,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.1 $
|
# @(#) $Revision: 30.3 $
|
||||||
# @(#) $Id: calcerr.tbl,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
# @(#) $Id: calcerr.tbl,v 30.3 2013/09/01 19:23:57 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr.tbl,v $
|
# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr.tbl,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1996/05/23 17:38:44
|
# Under source code control: 1996/05/23 17:38:44
|
||||||
@@ -32,6 +32,16 @@
|
|||||||
#
|
#
|
||||||
# SYMBOL meaning
|
# SYMBOL meaning
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# WARNING: The order of the lines below is critical! If you change #
|
||||||
|
# the order, you will break code that depends on the return #
|
||||||
|
# value of the errno() builtin function. #
|
||||||
|
# #
|
||||||
|
# If you need to add values to this table, ONLY add then #
|
||||||
|
# to the bottom of the file! #
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
|
||||||
E_1OVER0 Division by zero
|
E_1OVER0 Division by zero
|
||||||
E_0OVER0 Indeterminate (0/0)
|
E_0OVER0 Indeterminate (0/0)
|
||||||
E_ADD Bad arguments for +
|
E_ADD Bad arguments for +
|
||||||
@@ -449,3 +459,17 @@ E_FGETFILE1 Non-file argument for fgetfile
|
|||||||
E_FGETFILE2 File argument for fgetfile not open for reading
|
E_FGETFILE2 File argument for fgetfile not open for reading
|
||||||
E_FGETFILE3 Unable to set file position in fgetfile
|
E_FGETFILE3 Unable to set file position in fgetfile
|
||||||
E_ESTR Non-representable type for estr
|
E_ESTR Non-representable type for estr
|
||||||
|
E_STRCASECMP Non-string argument for strcasecmp
|
||||||
|
E_STRNCASECMP Bad argument type for strncasecmp
|
||||||
|
E_ISUPPER Bad argument for isupper
|
||||||
|
E_ISLOWER Bad argument for islower
|
||||||
|
E_ISALNUM Bad argument for isalnum
|
||||||
|
E_ISALPHA Bad argument for isalpha
|
||||||
|
E_ISASCII Bad argument for isascii
|
||||||
|
E_ISCNTRL Bad argument for iscntrl
|
||||||
|
E_ISDIGIT Bad argument for isdigit
|
||||||
|
E_ISGRAPH Bad argument for isgraph
|
||||||
|
E_ISPRINT Bad argument for isprint
|
||||||
|
E_ISPUNCT Bad argument for ispunct
|
||||||
|
E_ISSPACE Bad argument for isspace
|
||||||
|
E_ISXDIGIT Bad argument for isxdigit
|
||||||
|
@@ -18,9 +18,9 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.1 $
|
# @(#) $Revision: 30.2 $
|
||||||
# @(#) $Id: check.awk,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
# @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/check.awk,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1996/05/25 22:07:58
|
# Under source code control: 1996/05/25 22:07:58
|
||||||
# File existed as early as: 1996
|
# File existed as early as: 1996
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
#
|
#
|
||||||
# This awk script will print 3 lines before and after any non-blank line that
|
# This awk script will print 3 lines before and after any non-blank line that
|
||||||
# does not begin with a number. This allows the 'make debug' rule to remove
|
# does not begin with a number. This allows the 'make debug' rule to remove
|
||||||
# all non-interest lines the the 'make check' regression output while providing
|
# all non-interest lines the 'make check' regression output while providing
|
||||||
# 3 lines of context around unexpected output.
|
# 3 lines of context around unexpected output.
|
||||||
#
|
#
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
41
codegen.c
41
codegen.c
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.4 $
|
||||||
* @(#) $Id: codegen.c,v 30.2 2007/07/05 13:30:38 chongo Exp $
|
* @(#) $Id: codegen.c,v 30.4 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/codegen.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/codegen.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:13
|
* Under source code control: 1990/02/15 01:48:13
|
||||||
@@ -453,7 +453,8 @@ getsimplebody(void)
|
|||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
S_FUNC void
|
S_FUNC void
|
||||||
getbody(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *defaultlabel)
|
getbody(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel,
|
||||||
|
LABEL *defaultlabel)
|
||||||
{
|
{
|
||||||
int oldmode;
|
int oldmode;
|
||||||
|
|
||||||
@@ -617,7 +618,8 @@ getonevariable(int symtype)
|
|||||||
* defaultlabel label for default case
|
* defaultlabel label for default case
|
||||||
*/
|
*/
|
||||||
S_FUNC void
|
S_FUNC void
|
||||||
getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *defaultlabel)
|
getstatement(LABEL *contlabel, LABEL *breaklabel,
|
||||||
|
LABEL *nextcaselabel, LABEL *defaultlabel)
|
||||||
{
|
{
|
||||||
LABEL label;
|
LABEL label;
|
||||||
LABEL label1, label2, label3, label4; /* locations for jumps */
|
LABEL label1, label2, label3, label4; /* locations for jumps */
|
||||||
@@ -1104,7 +1106,8 @@ getobjdeclaration(int symtype)
|
|||||||
newindices = (int *) malloc(maxindices *
|
newindices = (int *) malloc(maxindices *
|
||||||
sizeof(int));
|
sizeof(int));
|
||||||
if (newindices == NULL) {
|
if (newindices == NULL) {
|
||||||
scanerror(T_SEMICOLON, "Out of memory for indices malloc");
|
scanerror(T_SEMICOLON,
|
||||||
|
"Out of memory for indices malloc");
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1117,7 +1120,8 @@ getobjdeclaration(int symtype)
|
|||||||
maxindices * sizeof(int));
|
maxindices * sizeof(int));
|
||||||
if (newindices == NULL) {
|
if (newindices == NULL) {
|
||||||
free(indices);
|
free(indices);
|
||||||
scanerror(T_SEMICOLON, "Out of memory for indices realloc");
|
scanerror(T_SEMICOLON,
|
||||||
|
"Out of memory for indices realloc");
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1129,7 +1133,9 @@ getobjdeclaration(int symtype)
|
|||||||
if (indices[i] == index) {
|
if (indices[i] == index) {
|
||||||
if (indices != quickindices)
|
if (indices != quickindices)
|
||||||
free(indices);
|
free(indices);
|
||||||
scanerror(T_SEMICOLON, "Duplicate element name \"%s\"", tokensymbol());
|
scanerror(T_SEMICOLON,
|
||||||
|
"Duplicate element name \"%s\"",
|
||||||
|
tokensymbol());
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1141,7 +1147,8 @@ getobjdeclaration(int symtype)
|
|||||||
if (gettoken() != T_RIGHTBRACE) {
|
if (gettoken() != T_RIGHTBRACE) {
|
||||||
if (indices != quickindices)
|
if (indices != quickindices)
|
||||||
free(indices);
|
free(indices);
|
||||||
scanerror(T_SEMICOLON, "Bad object type definition");
|
scanerror(T_SEMICOLON,
|
||||||
|
"Bad object type definition");
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1415,7 +1422,8 @@ getinitlist(void)
|
|||||||
oldmode = tokenmode(TM_DEFAULT);
|
oldmode = tokenmode(TM_DEFAULT);
|
||||||
|
|
||||||
if (gettoken() != T_LEFTBRACE) {
|
if (gettoken() != T_LEFTBRACE) {
|
||||||
scanerror(T_SEMICOLON, "Missing left brace for initialization list");
|
scanerror(T_SEMICOLON,
|
||||||
|
"Missing left brace for initialization list");
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1450,7 +1458,7 @@ getinitlist(void)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
scanerror(T_SEMICOLON,
|
scanerror(T_SEMICOLON,
|
||||||
"Missing right brace for initialization list");
|
"Missing right brace for initialization list");
|
||||||
(void) tokenmode(oldmode);
|
(void) tokenmode(oldmode);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2364,11 +2372,13 @@ getfilename(char *name, size_t namelen, BOOL *once)
|
|||||||
/* use symbol VALUE string */
|
/* use symbol VALUE string */
|
||||||
symstr = val.v_str->s_str;
|
symstr = val.v_str->s_str;
|
||||||
if (symstr == NULL) {
|
if (symstr == NULL) {
|
||||||
math_error("string value pointer is NULL!!");
|
math_error(
|
||||||
|
"string value pointer is NULL!!");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
math_error("a filename variable must be a string");
|
math_error(
|
||||||
|
"a filename variable must be a string");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2605,7 +2615,7 @@ definesymbol(char *name, int symtype)
|
|||||||
break;
|
break;
|
||||||
case SYM_GLOBAL:
|
case SYM_GLOBAL:
|
||||||
if (symtype == SYM_GLOBAL && conf->redecl_warn) {
|
if (symtype == SYM_GLOBAL && conf->redecl_warn) {
|
||||||
warning("redeclaraion of global \"%s\"",
|
warning("redeclaration of global \"%s\"",
|
||||||
name);
|
name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2613,7 +2623,7 @@ definesymbol(char *name, int symtype)
|
|||||||
|
|
||||||
case SYM_LOCAL:
|
case SYM_LOCAL:
|
||||||
if (symtype == SYM_LOCAL && conf->redecl_warn) {
|
if (symtype == SYM_LOCAL && conf->redecl_warn) {
|
||||||
warning("redeclaraion of local \"%s\"",
|
warning("redeclaration of local \"%s\"",
|
||||||
name);
|
name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2637,7 +2647,8 @@ definesymbol(char *name, int symtype)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (conf->dupvar_warn) {
|
if (conf->dupvar_warn) {
|
||||||
warning("both static and parameter \"%s\" defined", name);
|
warning("both static and parameter \"%s\" defined",
|
||||||
|
name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (symtype == SYM_LOCAL)
|
if (symtype == SYM_LOCAL)
|
||||||
|
13
config.c
13
config.c
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: config.c,v 30.2 2007/07/05 13:30:38 chongo Exp $
|
* @(#) $Id: config.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/config.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/config.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1991/07/20 00:21:56
|
* Under source code control: 1991/07/20 00:21:56
|
||||||
@@ -948,7 +948,8 @@ setconfig(int type, VALUE *vp)
|
|||||||
} else if (vp->v_type == V_STR) {
|
} else if (vp->v_type == V_STR) {
|
||||||
temp = lookup_long(truth, vp->v_str->s_str);
|
temp = lookup_long(truth, vp->v_str->s_str);
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
math_error("Illegal truth value for redecl_warn");
|
math_error("Illegal truth value for "
|
||||||
|
"redecl_warn");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
conf->redecl_warn = (int)temp;
|
conf->redecl_warn = (int)temp;
|
||||||
@@ -962,7 +963,8 @@ setconfig(int type, VALUE *vp)
|
|||||||
} else if (vp->v_type == V_STR) {
|
} else if (vp->v_type == V_STR) {
|
||||||
temp = lookup_long(truth, vp->v_str->s_str);
|
temp = lookup_long(truth, vp->v_str->s_str);
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
math_error("Illegal truth value for dupvar_warn");
|
math_error("Illegal truth value for "
|
||||||
|
"dupvar_warn");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
conf->dupvar_warn = (int)temp;
|
conf->dupvar_warn = (int)temp;
|
||||||
@@ -1153,7 +1155,8 @@ config_value(CONFIG *cfg, int type, VALUE *vp)
|
|||||||
vp->v_type = V_STR;
|
vp->v_type = V_STR;
|
||||||
p = lookup_name(modes, cfg->outmode2);
|
p = lookup_name(modes, cfg->outmode2);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
math_error("invalid secondary output mode: %d", cfg->outmode2);
|
math_error("invalid secondary output mode: %d",
|
||||||
|
cfg->outmode2);
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
vp->v_str = makenewstring(p);
|
vp->v_str = makenewstring(p);
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.3 $
|
# @(#) $Revision: 30.4 $
|
||||||
# @(#) $Id: Makefile,v 30.3 2007/09/21 01:27:27 chongo Exp $
|
# @(#) $Id: Makefile,v 30.4 2013/08/11 08:41:38 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1999/11/29 11:10:26
|
# Under source code control: 1999/11/29 11:10:26
|
||||||
@@ -315,7 +315,9 @@ depend:
|
|||||||
if [ X"$$i" != X"/dev/null" ]; then \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo "$$i: $$i.calc"; \
|
echo "$$i: $$i.calc"; \
|
||||||
echo ' @$${RM} -f $$@'; \
|
echo ' @$${RM} -f $$@'; \
|
||||||
echo ' @$${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
|
echo -n ' @$${SED} -e "1s:'; \
|
||||||
|
echo "^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" \
|
||||||
|
$$?>$$@'; \
|
||||||
echo ' @$${CHMOD} +x $$@'; \
|
echo ' @$${CHMOD} +x $$@'; \
|
||||||
fi; \
|
fi; \
|
||||||
done >> makedep.out
|
done >> makedep.out
|
||||||
@@ -323,7 +325,8 @@ depend:
|
|||||||
${Q} echo forming new cscript/${MAKE_FILE}
|
${Q} echo forming new cscript/${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} echo "" >> ${MAKE_FILE}
|
${Q} echo "" >> ${MAKE_FILE}
|
||||||
${Q} ${CAT} makedep.out >> ${MAKE_FILE}
|
${Q} ${CAT} makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -f makedep.out
|
${Q} ${RM} -f makedep.out
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.24 $
|
# @(#) $Revision: 30.29 $
|
||||||
# @(#) $Id: Makefile.head,v 30.24 2013/03/25 21:31:56 chongo Exp $
|
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1997/03/09 02:28:54
|
# Under source code control: 1997/03/09 02:28:54
|
||||||
@@ -366,7 +366,7 @@ EXT=
|
|||||||
|
|
||||||
# The default calc versions
|
# The default calc versions
|
||||||
#
|
#
|
||||||
VERSION= 2.12.4.6
|
VERSION= 2.12.4.11
|
||||||
VERS= 2.12.4
|
VERS= 2.12.4
|
||||||
VER= 2.12
|
VER= 2.12
|
||||||
VE= 2
|
VE= 2
|
||||||
@@ -473,16 +473,16 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
|||||||
# BLD_TYPE= calc-static-only
|
# BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
||||||
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs
|
# DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
|
||||||
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
||||||
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib
|
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
|
||||||
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
||||||
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
||||||
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib
|
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
|
||||||
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
||||||
@@ -495,8 +495,8 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
|||||||
# to abort on warnings, then leave CCWERR blank.
|
# to abort on warnings, then leave CCWERR blank.
|
||||||
# CCMISC are misc flags given to ${CC}
|
# CCMISC are misc flags given to ${CC}
|
||||||
#
|
#
|
||||||
# LCC how the the C compiler is invoked on locally executed intermediate progs
|
# LCC is how the C compiler is invoked on locally executed intermediate programs
|
||||||
# CC is how the the C compiler is invoked (with an optional Purify)
|
# CC is how the C compiler is invoked (with an optional Purify)
|
||||||
#
|
#
|
||||||
# Specific target overrides or modifications to default values
|
# Specific target overrides or modifications to default values
|
||||||
|
|
||||||
@@ -576,7 +576,7 @@ CCMISC= ${DARWIN_ARCH}
|
|||||||
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
|
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
#
|
#
|
||||||
# Darmin dynamic shared lib filenames
|
# Darwin dynamic shared lib filenames
|
||||||
LIB_EXT:= .dylib
|
LIB_EXT:= .dylib
|
||||||
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
||||||
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
|
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
|
||||||
@@ -779,10 +779,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
|
|||||||
#
|
#
|
||||||
# The simple makefile forces the use of static ${CC} flags
|
# The simple makefile forces the use of static ${CC} flags
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
||||||
CFLAGS= ${ICFLAGS} ${CCOPT}
|
CFLAGS= ${ICFLAGS} ${CCOPT}
|
||||||
@@ -882,8 +882,8 @@ endif
|
|||||||
|
|
||||||
# Required flags to compile C files for calc
|
# Required flags to compile C files for calc
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
|
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
|
||||||
#
|
#
|
||||||
@@ -896,8 +896,8 @@ CFLAGS= ${ICFLAGS} ${CCOPT}
|
|||||||
|
|
||||||
# Required flags to link files for calc
|
# Required flags to link files for calc
|
||||||
#
|
#
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ILDFLAGS= ${COMMON_LDFLAGS}
|
ILDFLAGS= ${COMMON_LDFLAGS}
|
||||||
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
||||||
@@ -1136,7 +1136,8 @@ depend:
|
|||||||
${Q} echo forming new custom/${MAKE_FILE}
|
${Q} echo forming new custom/${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -rf skel
|
${Q} ${RM} -rf skel
|
||||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||||
@@ -1333,7 +1334,8 @@ install: all
|
|||||||
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new ${T}${CUSTOMHELPDIR}/$$i; \
|
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new \
|
||||||
|
${T}${CUSTOMHELPDIR}/$$i; \
|
||||||
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.24 $
|
# @(#) $Revision: 30.29 $
|
||||||
# @(#) $Id: Makefile.head,v 30.24 2013/03/25 21:31:56 chongo Exp $
|
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1997/03/09 02:28:54
|
# Under source code control: 1997/03/09 02:28:54
|
||||||
@@ -366,7 +366,7 @@ EXT=
|
|||||||
|
|
||||||
# The default calc versions
|
# The default calc versions
|
||||||
#
|
#
|
||||||
VERSION= 2.12.4.6
|
VERSION= 2.12.4.11
|
||||||
VERS= 2.12.4
|
VERS= 2.12.4
|
||||||
VER= 2.12
|
VER= 2.12
|
||||||
VE= 2
|
VE= 2
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.24 $
|
# @(#) $Revision: 30.29 $
|
||||||
# @(#) $Id: Makefile.head,v 30.24 2013/03/25 21:31:56 chongo Exp $
|
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1997/03/09 02:28:54
|
# Under source code control: 1997/03/09 02:28:54
|
||||||
@@ -351,7 +351,7 @@ EXT=
|
|||||||
|
|
||||||
# The default calc versions
|
# The default calc versions
|
||||||
#
|
#
|
||||||
VERSION= 2.12.4.6
|
VERSION= 2.12.4.11
|
||||||
VERS= 2.12.4
|
VERS= 2.12.4
|
||||||
VER= 2.12
|
VER= 2.12
|
||||||
VE= 2
|
VE= 2
|
||||||
@@ -433,16 +433,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# BLD_TYPE= calc-static-only
|
# BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
|
||||||
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs
|
# DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
|
||||||
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
# LD_SHARE are common flags given to ${CC} to link with shared libraries
|
||||||
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib
|
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
|
||||||
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
|
||||||
#
|
#
|
||||||
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
|
||||||
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
# LD_STATIC are common flags given to ${CC} to link with static libraries
|
||||||
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib
|
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
|
||||||
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
|
||||||
#
|
#
|
||||||
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
|
||||||
@@ -455,8 +455,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
|||||||
# to abort on warnings, then leave CCWERR blank.
|
# to abort on warnings, then leave CCWERR blank.
|
||||||
# CCMISC are misc flags given to ${CC}
|
# CCMISC are misc flags given to ${CC}
|
||||||
#
|
#
|
||||||
# LCC how the the C compiler is invoked on locally executed intermediate progs
|
# LCC is how the C compiler is invoked on locally executed intermediate programs
|
||||||
# CC is how the the C compiler is invoked (with an optional Purify)
|
# CC is how the C compiler is invoked (with an optional Purify)
|
||||||
#
|
#
|
||||||
# Specific target overrides or modifications to default values
|
# Specific target overrides or modifications to default values
|
||||||
|
|
||||||
@@ -495,10 +495,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
|
|||||||
#
|
#
|
||||||
# The simple makefile forces the use of static ${CC} flags
|
# The simple makefile forces the use of static ${CC} flags
|
||||||
#
|
#
|
||||||
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
|
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
||||||
# CFLAGS are given to ${CC} for calc progs other than intermediate progs
|
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
||||||
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
|
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
||||||
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs
|
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
||||||
#
|
#
|
||||||
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
|
||||||
CFLAGS= ${ICFLAGS} ${CCOPT}
|
CFLAGS= ${ICFLAGS} ${CCOPT}
|
||||||
@@ -729,7 +729,8 @@ depend:
|
|||||||
${Q} echo forming new custom/${MAKE_FILE}
|
${Q} echo forming new custom/${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -rf skel
|
${Q} ${RM} -rf skel
|
||||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||||
@@ -923,7 +924,8 @@ install: all
|
|||||||
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new ${T}${CUSTOMHELPDIR}/$$i; \
|
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new \
|
||||||
|
${T}${CUSTOMHELPDIR}/$$i; \
|
||||||
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
@@ -227,7 +227,8 @@ depend:
|
|||||||
${Q} echo forming new custom/${MAKE_FILE}
|
${Q} echo forming new custom/${MAKE_FILE}
|
||||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
|
||||||
|
${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||||
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
||||||
${Q} ${RM} -rf skel
|
${Q} ${RM} -rf skel
|
||||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||||
@@ -424,7 +425,8 @@ install: all
|
|||||||
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new ${T}${CUSTOMHELPDIR}/$$i; \
|
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new \
|
||||||
|
${T}${CUSTOMHELPDIR}/$$i; \
|
||||||
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.4 $
|
||||||
* @(#) $Id: c_sysinfo.c,v 30.2 2007/07/05 19:35:20 chongo Exp $
|
* @(#) $Id: c_sysinfo.c,v 30.4 2013/09/01 22:16:21 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_sysinfo.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_sysinfo.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/03/09 23:14:40
|
* Under source code control: 1997/03/09 23:14:40
|
||||||
@@ -71,93 +71,180 @@ struct infoname {
|
|||||||
FULL nmbr; /* if str==NULL ==> value fo #define as a FULL */
|
FULL nmbr; /* if str==NULL ==> value fo #define as a FULL */
|
||||||
};
|
};
|
||||||
STATIC struct infoname sys_info[] = {
|
STATIC struct infoname sys_info[] = {
|
||||||
{"S100", "slots in an subtractive 100 table", NULL, (FULL)S100},
|
{"S100", "slots in an subtractive 100 table", NULL,
|
||||||
{"BASE", "base for calculations", NULL, (FULL)BASE},
|
(FULL)S100},
|
||||||
{"BASE1", "one less than base", NULL, (FULL)BASE},
|
{"BASE", "base for calculations", NULL,
|
||||||
{"BASEB", "bits in the calculation base", NULL, (FULL)BASEB},
|
(FULL)BASE},
|
||||||
{"BASEDIG", "number of digits in base", NULL, (FULL)BASEDIG},
|
{"BASE1", "one less than base", NULL,
|
||||||
{"BIG_ENDIAN", "Most Significant Byte first symbol", NULL, (FULL)BIG_ENDIAN},
|
(FULL)BASE},
|
||||||
{"BLK_CHUNKSIZE", "default allocation chunk size for blocks", NULL, (FULL)BLK_CHUNKSIZE},
|
{"BASEB", "bits in the calculation base", NULL,
|
||||||
{"BLK_DEF_MAXPRINT", "default block octets to print", NULL, (FULL)BLK_DEF_MAXPRINT},
|
(FULL)BASEB},
|
||||||
{"BLUM_PREGEN", "non-default predefined Blum generators", NULL, (FULL)BLUM_PREGEN},
|
{"BASEDIG", "number of digits in base", NULL,
|
||||||
{"CALCEXT", "extension for files read in", CALCEXT, (FULL)0},
|
(FULL)BASEDIG},
|
||||||
{"CALC_BYTE_ORDER", "Byte order (LITTLE_ENDIAN or BIG_ENDIAN)", NULL, (FULL)CALC_BYTE_ORDER},
|
{"BIG_ENDIAN", "Most Significant Byte first symbol", NULL,
|
||||||
{"CUSTOMHELPDIR", "location of the custom help directory", CUSTOMHELPDIR, (FULL)0},
|
(FULL)BIG_ENDIAN},
|
||||||
{"DEFAULTCALCBINDINGS", "default key bindings file", DEFAULTCALCBINDINGS, (FULL)0},
|
{"BLK_CHUNKSIZE", "default allocation chunk size for blocks", NULL,
|
||||||
{"DEFAULTCALCHELP", "help file that -h prints", DEFAULTCALCHELP, (FULL)0},
|
(FULL)BLK_CHUNKSIZE},
|
||||||
{"DEFAULTCALCPAGER", "default pager", DEFAULTCALCPAGER, (FULL)0},
|
{"BLK_DEF_MAXPRINT", "default block octets to print", NULL,
|
||||||
{"DEFAULTCALCPATH", "default :-separated search path", DEFAULTCALCPATH, (FULL)0},
|
(FULL)BLK_DEF_MAXPRINT},
|
||||||
{"DEFAULTCALCRC", "default :-separated startup file list", DEFAULTCALCRC, (FULL)0},
|
{"BLUM_PREGEN", "non-default predefined Blum generators", NULL,
|
||||||
{"DEFAULTSHELL", "default shell to use", DEFAULTSHELL, (FULL)0},
|
(FULL)BLUM_PREGEN},
|
||||||
{"DEV_BITS", "device number size in bits", NULL, (FULL)DEV_BITS},
|
{"CALCEXT", "extension for files read in", CALCEXT,
|
||||||
{"DISPLAY_DEFAULT", "default digits for float display", NULL, (FULL)DISPLAY_DEFAULT},
|
(FULL)0},
|
||||||
{"EPSILONPREC_DEFAULT", "2^-EPSILON_DEFAULT <= EPSILON_DEFAULT", NULL, (FULL)EPSILONPREC_DEFAULT},
|
{"CALC_BYTE_ORDER", "Byte order (LITTLE_ENDIAN or BIG_ENDIAN)", NULL,
|
||||||
{"EPSILON_DEFAULT", "allowed error for float calculations", EPSILON_DEFAULT, (FULL)0},
|
(FULL)CALC_BYTE_ORDER},
|
||||||
{"ERRMAX", "default errmax value", NULL, (FULL)ERRMAX},
|
{"CUSTOMHELPDIR", "location of the custom help directory", CUSTOMHELPDIR,
|
||||||
{"E_USERDEF", "base of user defined errors", NULL, (FULL)E_USERDEF},
|
(FULL)0},
|
||||||
{"E__BASE", "calc errors start above here", NULL, (FULL)E__BASE},
|
{"DEFAULTCALCBINDINGS", "default key bindings file", DEFAULTCALCBINDINGS,
|
||||||
{"E__COUNT", "number of calc errors", NULL, (FULL)E__COUNT},
|
(FULL)0},
|
||||||
{"E__HIGHEST", "highest calc error", NULL, (FULL)E__HIGHEST},
|
{"DEFAULTCALCHELP", "help file that -h prints", DEFAULTCALCHELP,
|
||||||
{"FALSE", "boolean false", NULL, (FULL)FALSE},
|
(FULL)0},
|
||||||
{"FILEPOS_BITS", "file position size in bits", NULL, (FULL)FILEPOS_BITS},
|
{"DEFAULTCALCPAGER", "default pager", DEFAULTCALCPAGER,
|
||||||
{"FULL_BITS", "bits in a FULL", NULL, (FULL)FULL_BITS},
|
(FULL)0},
|
||||||
{"HELPDIR", "location of the help directory", HELPDIR, (FULL)0},
|
{"DEFAULTCALCPATH", "default :-separated search path", DEFAULTCALCPATH,
|
||||||
{"HIST_BINDING_FILE", "Default binding file", HIST_BINDING_FILE, (FULL)0},
|
(FULL)0},
|
||||||
{"HIST_SIZE", "Default history size", NULL, (FULL)HIST_SIZE},
|
{"DEFAULTCALCRC", "default :-separated startup file list", DEFAULTCALCRC,
|
||||||
{"INIT_J", "initial 1st walking a55 table index", NULL, (FULL)INIT_J},
|
(FULL)0},
|
||||||
{"INIT_K", "initial 2nd walking a55 table index", NULL, (FULL)INIT_K},
|
{"DEFAULTSHELL", "default shell to use", DEFAULTSHELL,
|
||||||
{"INODE_BITS", "inode number size in bits", NULL, (FULL)INODE_BITS},
|
(FULL)0},
|
||||||
{"LITTLE_ENDIAN", "Least Significant Byte first symbol", NULL, (FULL)LITTLE_ENDIAN},
|
{"DEV_BITS", "device number size in bits", NULL,
|
||||||
{"LONG_BITS", "bit length of a long", NULL, (FULL)LONG_BITS},
|
(FULL)DEV_BITS},
|
||||||
{"MAP_POPCNT", "number of odd primes in pr_map", NULL, (FULL)MAP_POPCNT},
|
{"DISPLAY_DEFAULT", "default digits for float display", NULL,
|
||||||
{"MAX_CALCRC", "maximum allowed length of $CALCRC", NULL, (FULL)MAX_CALCRC},
|
(FULL)DISPLAY_DEFAULT},
|
||||||
{"MAXCMD", "max length of command invocation", NULL, (FULL)MAXCMD},
|
{"EPSILONPREC_DEFAULT", "2^-EPSILON_DEFAULT <= EPSILON_DEFAULT", NULL,
|
||||||
{"MAXDIM", "max number of dimensions in matrices", NULL, (FULL)MAXDIM},
|
(FULL)EPSILONPREC_DEFAULT},
|
||||||
{"MAXERROR", "max length of error message string", NULL, (FULL)MAXERROR},
|
{"EPSILON_DEFAULT", "allowed error for float calculations",
|
||||||
{"MAXFILES", "max number of opened files", NULL, (FULL)MAXFILES},
|
EPSILON_DEFAULT, (FULL)0},
|
||||||
{"MAXFULL", "largest SFULL value", NULL, (FULL)MAXFULL},
|
{"ERRMAX", "default errmax value", NULL,
|
||||||
{"MAXHALF", "largest SHALF value", NULL, (FULL)MAXHALF},
|
(FULL)ERRMAX},
|
||||||
{"MAXLABELS", "max number of user labels in function", NULL, (FULL)MAXLABELS},
|
{"E_USERDEF", "base of user defined errors", NULL,
|
||||||
{"MAXLEN", "longest storage size allowed", NULL, (FULL)MAXLEN},
|
(FULL)E_USERDEF},
|
||||||
{"MAXLONG", "largest long val", NULL, (FULL)MAXLONG},
|
{"E__BASE", "calc errors start above here", NULL,
|
||||||
{"MAXPRINT_DEFAULT", "default number of elements printed", NULL, (FULL)MAXPRINT_DEFAULT},
|
(FULL)E__BASE},
|
||||||
{"MAXREDC", "number of entries in REDC cache", NULL, (FULL)MAXREDC},
|
{"E__COUNT", "number of calc errors", NULL,
|
||||||
{"MAXSCANCOUNT", "default max scan errors before an abort", NULL, (FULL)MAXSCANCOUNT},
|
(FULL)E__COUNT},
|
||||||
{"MAXSTACK", "max depth of evaluation stack", NULL, (FULL)MAXSTACK},
|
{"E__HIGHEST", "highest calc error", NULL,
|
||||||
{"MAXSTRING", "max size of string constant", NULL, (FULL)MAXSTRING},
|
(FULL)E__HIGHEST},
|
||||||
{"MAXUFULL", "largest FULL value", NULL, (FULL)MAXUFULL},
|
{"FALSE", "boolean false", NULL,
|
||||||
{"MAXULONG", "largest unsigned long val", NULL, (FULL)MAXULONG},
|
(FULL)FALSE},
|
||||||
{"MAX_MAP_PRIME", "larest prime in pr_map", NULL, (FULL)MAX_MAP_PRIME},
|
{"FILEPOS_BITS", "file position size in bits", NULL,
|
||||||
{"MAX_MAP_VAL", "larest bit in pr_map", NULL, (FULL)MAX_MAP_VAL},
|
(FULL)FILEPOS_BITS},
|
||||||
{"MAX_PFACT_VAL", "max x, for which pfact(x) is a long", NULL, (FULL)MAX_PFACT_VAL},
|
{"FULL_BITS", "bits in a FULL", NULL,
|
||||||
{"MAX_SM_PRIME", "larest 32 bit prime", NULL, (FULL)MAX_SM_PRIME},
|
(FULL)FULL_BITS},
|
||||||
{"MAX_SM_VAL", "larest 32 bit value", NULL, (FULL)MAX_SM_VAL},
|
{"HELPDIR", "location of the help directory", HELPDIR,
|
||||||
{"MUL_ALG2", "default size for alternative multiply", NULL, (FULL)MUL_ALG2},
|
(FULL)0},
|
||||||
{"NXT_MAP_PRIME", "smallest odd prime not in pr_map", NULL, (FULL)NXT_MAP_PRIME},
|
{"HIST_BINDING_FILE", "Default binding file", HIST_BINDING_FILE,
|
||||||
{"NXT_PFACT_VAL", "next prime for higher pfact values", NULL, (FULL)NXT_PFACT_VAL},
|
(FULL)0},
|
||||||
{"OFF_T_BITS", "file offset size in bits", NULL, (FULL)OFF_T_BITS},
|
{"HIST_SIZE", "Default history size", NULL,
|
||||||
{"PIX_32B", "max pix() value", NULL, (FULL)PIX_32B},
|
(FULL)HIST_SIZE},
|
||||||
{"POW_ALG2", "default size for using REDC for powers", NULL, (FULL)POW_ALG2},
|
{"INIT_J", "initial 1st walking a55 table index", NULL,
|
||||||
{"REDC_ALG2", "default size using alternative REDC alg", NULL, (FULL)REDC_ALG2},
|
(FULL)INIT_J},
|
||||||
{"SBITS", "size of additive or shuffle entry in bits", NULL, (FULL)SBITS},
|
{"INIT_K", "initial 2nd walking a55 table index", NULL,
|
||||||
{"SBYTES", "size of additive or shuffle entry in bytes", NULL, (FULL)SBYTES},
|
(FULL)INIT_K},
|
||||||
{"SCNT", "length of additive 55 table in FULLs", NULL, (FULL)SCNT},
|
{"INODE_BITS", "inode number size in bits", NULL,
|
||||||
{"SEEDXORBITS", "low bits of a55 seed devoted to xor", NULL, (FULL)SEEDXORBITS},
|
(FULL)INODE_BITS},
|
||||||
{"SHALFS", "size of additive or shuffle entry in HALFs", NULL, (FULL)SHALFS},
|
{"LITTLE_ENDIAN", "Least Significant Byte first symbol",
|
||||||
{"SHUFCNT", "size of shuffle table in entries", NULL, (FULL)SHUFCNT},
|
NULL, (FULL)LITTLE_ENDIAN},
|
||||||
{"SHUFLEN", "length of shuffle table in FULLs", NULL, (FULL)SHUFLEN},
|
{"LONG_BITS", "bit length of a long", NULL,
|
||||||
{"SHUFMASK", "mask for shuffle table entry selection", NULL, (FULL)SHUFMASK},
|
(FULL)LONG_BITS},
|
||||||
{"SHUFPOW", "power of 2 size of the shuffle table", NULL, (FULL)SHUFPOW},
|
{"MAP_POPCNT", "number of odd primes in pr_map", NULL,
|
||||||
{"SLEN", "number of FULLs in a shuffle table entry", NULL, (FULL)SLEN},
|
(FULL)MAP_POPCNT},
|
||||||
{"SQ_ALG2", "default size for alternative squaring", NULL, (FULL)SQ_ALG2},
|
{"MAX_CALCRC", "maximum allowed length of $CALCRC", NULL,
|
||||||
{"SYMBOLSIZE", "max symbol name size", NULL, (FULL)SYMBOLSIZE},
|
(FULL)MAX_CALCRC},
|
||||||
{"TEN_MAX", "10^(2^TEN_MAX): largest base10 conversion const", NULL, (FULL)TEN_MAX},
|
{"MAXCMD", "max length of command invocation", NULL,
|
||||||
{"TOPFULL", "highest bit in FULL", NULL, (FULL)TOPFULL},
|
(FULL)MAXCMD},
|
||||||
{"TOPHALF", "highest bit in a HALF", NULL, (FULL)TOPHALF},
|
{"MAXDIM", "max number of dimensions in matrices", NULL,
|
||||||
{"TOPLONG", "top long bit", NULL, (FULL)TOPLONG},
|
(FULL)MAXDIM},
|
||||||
{"TRUE", "boolean true", NULL, (FULL)TRUE},
|
{"MAXERROR", "max length of error message string", NULL,
|
||||||
{"USUAL_ELEMENTS", "usual number of elements for objects", NULL, (FULL)USUAL_ELEMENTS},
|
(FULL)MAXERROR},
|
||||||
{"REGNUM_MAX", "highest custom register number", NULL, (FULL)CUSTOM_REG_MAX},
|
{"MAXFILES", "max number of opened files", NULL,
|
||||||
|
(FULL)MAXFILES},
|
||||||
|
{"MAXFULL", "largest SFULL value", NULL,
|
||||||
|
(FULL)MAXFULL},
|
||||||
|
{"MAXHALF", "largest SHALF value", NULL,
|
||||||
|
(FULL)MAXHALF},
|
||||||
|
{"MAXLABELS", "max number of user labels in function", NULL,
|
||||||
|
(FULL)MAXLABELS},
|
||||||
|
{"MAXLEN", "longest storage size allowed", NULL,
|
||||||
|
(FULL)MAXLEN},
|
||||||
|
{"MAXLONG", "largest long val", NULL,
|
||||||
|
(FULL)MAXLONG},
|
||||||
|
{"MAXPRINT_DEFAULT", "default number of elements printed", NULL,
|
||||||
|
(FULL)MAXPRINT_DEFAULT},
|
||||||
|
{"MAXREDC", "number of entries in REDC cache", NULL,
|
||||||
|
(FULL)MAXREDC},
|
||||||
|
{"MAXSCANCOUNT", "default max scan errors before an abort", NULL,
|
||||||
|
(FULL)MAXSCANCOUNT},
|
||||||
|
{"MAXSTACK", "max depth of evaluation stack", NULL,
|
||||||
|
(FULL)MAXSTACK},
|
||||||
|
{"MAXSTRING", "max size of string constant", NULL,
|
||||||
|
(FULL)MAXSTRING},
|
||||||
|
{"MAXUFULL", "largest FULL value", NULL,
|
||||||
|
(FULL)MAXUFULL},
|
||||||
|
{"MAXULONG", "largest unsigned long val", NULL,
|
||||||
|
(FULL)MAXULONG},
|
||||||
|
{"MAX_MAP_PRIME", "larest prime in pr_map", NULL,
|
||||||
|
(FULL)MAX_MAP_PRIME},
|
||||||
|
{"MAX_MAP_VAL", "larest bit in pr_map", NULL,
|
||||||
|
(FULL)MAX_MAP_VAL},
|
||||||
|
{"MAX_PFACT_VAL", "max x, for which pfact(x) is a long", NULL,
|
||||||
|
(FULL)MAX_PFACT_VAL},
|
||||||
|
{"MAX_SM_PRIME", "larest 32 bit prime", NULL,
|
||||||
|
(FULL)MAX_SM_PRIME},
|
||||||
|
{"MAX_SM_VAL", "larest 32 bit value", NULL,
|
||||||
|
(FULL)MAX_SM_VAL},
|
||||||
|
{"MUL_ALG2", "default size for alternative multiply", NULL,
|
||||||
|
(FULL)MUL_ALG2},
|
||||||
|
{"NXT_MAP_PRIME", "smallest odd prime not in pr_map", NULL,
|
||||||
|
(FULL)NXT_MAP_PRIME},
|
||||||
|
{"NXT_PFACT_VAL", "next prime for higher pfact values", NULL,
|
||||||
|
(FULL)NXT_PFACT_VAL},
|
||||||
|
{"OFF_T_BITS", "file offset size in bits", NULL,
|
||||||
|
(FULL)OFF_T_BITS},
|
||||||
|
{"PIX_32B", "max pix() value", NULL,
|
||||||
|
(FULL)PIX_32B},
|
||||||
|
{"POW_ALG2", "default size for using REDC for powers", NULL,
|
||||||
|
(FULL)POW_ALG2},
|
||||||
|
{"REDC_ALG2", "default size using alternative REDC alg", NULL,
|
||||||
|
(FULL)REDC_ALG2},
|
||||||
|
{"SBITS", "size of additive or shuffle entry in bits", NULL,
|
||||||
|
(FULL)SBITS},
|
||||||
|
{"SBYTES", "size of additive or shuffle entry in bytes", NULL,
|
||||||
|
(FULL)SBYTES},
|
||||||
|
{"SCNT", "length of additive 55 table in FULLs", NULL,
|
||||||
|
(FULL)SCNT},
|
||||||
|
{"SEEDXORBITS", "low bits of a55 seed devoted to xor", NULL,
|
||||||
|
(FULL)SEEDXORBITS},
|
||||||
|
{"SHALFS", "size of additive or shuffle entry in HALFs", NULL,
|
||||||
|
(FULL)SHALFS},
|
||||||
|
{"SHUFCNT", "size of shuffle table in entries", NULL,
|
||||||
|
(FULL)SHUFCNT},
|
||||||
|
{"SHUFLEN", "length of shuffle table in FULLs", NULL,
|
||||||
|
(FULL)SHUFLEN},
|
||||||
|
{"SHUFMASK", "mask for shuffle table entry selection", NULL,
|
||||||
|
(FULL)SHUFMASK},
|
||||||
|
{"SHUFPOW", "power of 2 size of the shuffle table", NULL,
|
||||||
|
(FULL)SHUFPOW},
|
||||||
|
{"SLEN", "number of FULLs in a shuffle table entry", NULL,
|
||||||
|
(FULL)SLEN},
|
||||||
|
{"SQ_ALG2", "default size for alternative squaring", NULL,
|
||||||
|
(FULL)SQ_ALG2},
|
||||||
|
{"SYMBOLSIZE", "max symbol name size", NULL,
|
||||||
|
(FULL)SYMBOLSIZE},
|
||||||
|
{"TEN_MAX", "10^(2^TEN_MAX): largest base10 conversion const", NULL,
|
||||||
|
(FULL)TEN_MAX},
|
||||||
|
{"TOPFULL", "highest bit in FULL", NULL,
|
||||||
|
(FULL)TOPFULL},
|
||||||
|
{"TOPHALF", "highest bit in a HALF", NULL,
|
||||||
|
(FULL)TOPHALF},
|
||||||
|
{"TOPLONG", "top long bit", NULL,
|
||||||
|
(FULL)TOPLONG},
|
||||||
|
{"TRUE", "boolean true", NULL,
|
||||||
|
(FULL)TRUE},
|
||||||
|
{"USUAL_ELEMENTS", "usual number of elements for objects", NULL,
|
||||||
|
(FULL)USUAL_ELEMENTS},
|
||||||
|
{"REGNUM_MAX", "highest custom register number", NULL,
|
||||||
|
(FULL)CUSTOM_REG_MAX},
|
||||||
|
|
||||||
/* must be last */
|
/* must be last */
|
||||||
{NULL, NULL, NULL, (FULL)0}
|
{NULL, NULL, NULL, (FULL)0}
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: pmodm127.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
* @(#) $Id: pmodm127.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pmodm127.cal,v $
|
* @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pmodm127.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2004/02/25 14:25:32
|
* Under source code control: 2004/02/25 14:25:32
|
||||||
@@ -120,7 +120,8 @@ define pmodm127_test2(testcnt, seed)
|
|||||||
/* compare custom function with its pmod() equivalent */
|
/* compare custom function with its pmod() equivalent */
|
||||||
if (pmod(2, m127, q) != custom("pmodm127", q)) {
|
if (pmod(2, m127, q) != custom("pmodm127", q)) {
|
||||||
print "ERROR: pmodm127 failed for ", str(q);
|
print "ERROR: pmodm127 failed for ", str(q);
|
||||||
print "ERROR: ", pmod(2,m127,q), " != ", custom("pmodm127", q);
|
print "ERROR: ", pmod(2,m127,q), " != ",
|
||||||
|
custom("pmodm127", q);
|
||||||
return newerror("pmodm127 failed for " + str(q));
|
return newerror("pmodm127 failed for " + str(q));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,5 +134,6 @@ define pmodm127_test2(testcnt, seed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((config("resource_debug") & 3) && !(config("resource_debug") & 8)) {
|
if ((config("resource_debug") & 3) && !(config("resource_debug") & 8)) {
|
||||||
print "DEBUG: use config('resource_debug',", config("resource_debug")|8:") to enable more debugging";
|
print "DEBUG: use config('resource_debug',",
|
||||||
|
config("resource_debug")|8 : ") to enable more debugging";
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ TYPES
|
|||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
||||||
This custom function will return the value certain selected #defile
|
This custom function will return the value certain selected #define
|
||||||
values. The infoname arg must be a string that matches the given
|
values. The infoname arg must be a string that matches the given
|
||||||
#define name. For conveience, the case infoname does not matter,
|
#define name. For conveience, the case infoname does not matter,
|
||||||
so "baseb" and "BASEB" refer to the same #define value.
|
so "baseb" and "BASEB" refer to the same #define value.
|
||||||
@@ -69,8 +69,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.2 $
|
||||||
## @(#) $Id: sysinfo,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
## @(#) $Id: sysinfo,v 30.2 2013/08/17 01:57:37 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/sysinfo,v $
|
## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/sysinfo,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/03/09 23:14:40
|
## Under source code control: 1997/03/09 23:14:40
|
||||||
|
7
decl.h
7
decl.h
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.3 $
|
* @(#) $Revision: 30.4 $
|
||||||
* @(#) $Id: decl.h,v 30.3 2008/04/15 21:17:57 chongo Exp $
|
* @(#) $Id: decl.h,v 30.4 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/decl.h,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/decl.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2007/02/09 05:24:25
|
* Under source code control: 2007/02/09 05:24:25
|
||||||
@@ -100,7 +100,8 @@
|
|||||||
|
|
||||||
/* Perform printf-style argument type checking for known compilers */
|
/* Perform printf-style argument type checking for known compilers */
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# define PRINTF_FORMAT(fmt_idx, arg_idx) __attribute__ ((format (printf, fmt_idx, arg_idx)))
|
# define PRINTF_FORMAT(fmt_idx, arg_idx) __attribute__ \
|
||||||
|
((format (printf, fmt_idx, arg_idx)))
|
||||||
#else
|
#else
|
||||||
# define PRINTF_FORMAT(fmt_idx, arg_idx)
|
# define PRINTF_FORMAT(fmt_idx, arg_idx)
|
||||||
#endif
|
#endif
|
||||||
|
8
endian.c
8
endian.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* endian - determine the byte order of a long on your machine
|
* endian - determine the byte order of a long on your machine
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 Landon Curt Noll
|
* Copyright (C) 1999-2013 Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.3 $
|
* @(#) $Revision: 30.4 $
|
||||||
* @(#) $Id: endian.c,v 30.3 2010/09/02 09:47:46 chongo Exp $
|
* @(#) $Id: endian.c,v 30.4 2013/05/05 13:57:08 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/endian.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/endian.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/11/15 04:32:58
|
* Under source code control: 1993/11/15 04:32:58
|
||||||
@@ -54,7 +54,9 @@ int
|
|||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
/* pointers into the byte order array */
|
/* pointers into the byte order array */
|
||||||
|
#if defined(DEBUG) || (!defined(BIG_ENDIAN) && !defined(BIG_ENDIAN))
|
||||||
int *intp = (int *)byte;
|
int *intp = (int *)byte;
|
||||||
|
#endif
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
short *shortp = (short *)byte;
|
short *shortp = (short *)byte;
|
||||||
long *longp = (long *)byte;
|
long *longp = (long *)byte;
|
||||||
|
13
file.c
13
file.c
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: file.c,v 30.2 2007/07/05 13:30:38 chongo Exp $
|
* @(#) $Id: file.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1991/07/20 00:21:56
|
* Under source code control: 1991/07/20 00:21:56
|
||||||
@@ -367,7 +367,8 @@ openid(char *name, char *mode)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* openpathid - open the specified abse filename, or relative filename along a search path
|
* openpathid - open the specified abse filename, or
|
||||||
|
* relative filename along a search path
|
||||||
*
|
*
|
||||||
* given:
|
* given:
|
||||||
* name file name
|
* name file name
|
||||||
@@ -2026,7 +2027,8 @@ showfiles(void)
|
|||||||
* strptr pointer to where the new field pointer may be found
|
* strptr pointer to where the new field pointer may be found
|
||||||
*/
|
*/
|
||||||
S_FUNC void
|
S_FUNC void
|
||||||
getscanfield(FILE *fp, BOOL skip, unsigned int width, int scannum, char *scanptr, char **strptr)
|
getscanfield(FILE *fp, BOOL skip, unsigned int width, int scannum,
|
||||||
|
char *scanptr, char **strptr)
|
||||||
{
|
{
|
||||||
char *str; /* current string */
|
char *str; /* current string */
|
||||||
unsigned long len; /* current length of string */
|
unsigned long len; /* current length of string */
|
||||||
@@ -2104,7 +2106,8 @@ getscanfield(FILE *fp, BOOL skip, unsigned int width, int scannum, char *scanptr
|
|||||||
* strptr pointer to where the new field pointer may be found
|
* strptr pointer to where the new field pointer may be found
|
||||||
*/
|
*/
|
||||||
S_FUNC void
|
S_FUNC void
|
||||||
getscanwhite(FILE *fp, BOOL skip, unsigned int width, int scannum, char **strptr)
|
getscanwhite(FILE *fp, BOOL skip, unsigned int width, int scannum,
|
||||||
|
char **strptr)
|
||||||
{
|
{
|
||||||
char *str; /* current string */
|
char *str; /* current string */
|
||||||
unsigned long len; /* current length of string */
|
unsigned long len; /* current length of string */
|
||||||
|
7
file.h
7
file.h
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: file.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: file.h,v 30.3 2013/09/01 22:16:21 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1996/05/24 05:55:58
|
* Under source code control: 1996/05/24 05:55:58
|
||||||
@@ -96,7 +96,8 @@ E_FUNC int fgetposid(FILEID id, FILEPOS *ptr);
|
|||||||
E_FUNC int fsetposid(FILEID id, FILEPOS *ptr);
|
E_FUNC int fsetposid(FILEID id, FILEPOS *ptr);
|
||||||
E_FUNC int get_open_siz(FILE *fp, ZVALUE *res);
|
E_FUNC int get_open_siz(FILE *fp, ZVALUE *res);
|
||||||
E_FUNC char* findfname(FILEID);
|
E_FUNC char* findfname(FILEID);
|
||||||
E_FUNC FILE *f_pathopen(char *name, char *mode, char *pathlist, char **openpath);
|
E_FUNC FILE *f_pathopen(char *name, char *mode, char *pathlist,
|
||||||
|
char **openpath);
|
||||||
|
|
||||||
|
|
||||||
#endif /* !__FILE_H__ */
|
#endif /* !__FILE_H__ */
|
||||||
|
433
func.c
433
func.c
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.3 $
|
* @(#) $Revision: 30.8 $
|
||||||
* @(#) $Id: func.c,v 30.3 2008/04/15 21:17:57 chongo Exp $
|
* @(#) $Id: func.c,v 30.8 2013/09/01 22:11:07 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:15
|
* Under source code control: 1990/02/15 01:48:15
|
||||||
@@ -2062,7 +2062,8 @@ f_ln(int count, VALUE **vals)
|
|||||||
}
|
}
|
||||||
switch (vals[0]->v_type) {
|
switch (vals[0]->v_type) {
|
||||||
case V_NUM:
|
case V_NUM:
|
||||||
if (!qisneg(vals[0]->v_num) && !qiszero(vals[0]->v_num)) {
|
if (!qisneg(vals[0]->v_num) &&
|
||||||
|
!qiszero(vals[0]->v_num)) {
|
||||||
result.v_num = qln(vals[0]->v_num, err);
|
result.v_num = qln(vals[0]->v_num, err);
|
||||||
result.v_type = V_NUM;
|
result.v_type = V_NUM;
|
||||||
return result;
|
return result;
|
||||||
@@ -2107,7 +2108,8 @@ f_log(int count, VALUE **vals)
|
|||||||
}
|
}
|
||||||
switch (vals[0]->v_type) {
|
switch (vals[0]->v_type) {
|
||||||
case V_NUM:
|
case V_NUM:
|
||||||
if (!qisneg(vals[0]->v_num) && !qiszero(vals[0]->v_num)) {
|
if (!qisneg(vals[0]->v_num) &&
|
||||||
|
!qiszero(vals[0]->v_num)) {
|
||||||
result.v_num = qlog(vals[0]->v_num, err);
|
result.v_num = qlog(vals[0]->v_num, err);
|
||||||
result.v_type = V_NUM;
|
result.v_type = V_NUM;
|
||||||
return result;
|
return result;
|
||||||
@@ -4175,6 +4177,24 @@ f_strcmp(VALUE *v1, VALUE *v2)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_strcasecmp(VALUE *v1, VALUE *v2)
|
||||||
|
{
|
||||||
|
VALUE result;
|
||||||
|
FLAG flag;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
if (v1->v_type != V_STR || v2->v_type != V_STR)
|
||||||
|
return error_value(E_STRCASECMP);
|
||||||
|
|
||||||
|
flag = stringcaserel(v1->v_str, v2->v_str);
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq((long) flag);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
S_FUNC VALUE
|
S_FUNC VALUE
|
||||||
f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3)
|
f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3)
|
||||||
@@ -4207,7 +4227,37 @@ f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3)
|
|||||||
result.v_num = itoq((long) flag);
|
result.v_num = itoq((long) flag);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_strncasecmp(VALUE *v1, VALUE *v2, VALUE *v3)
|
||||||
|
{
|
||||||
|
long n1, n2, n;
|
||||||
|
FLAG flag;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
if (v1->v_type != V_STR || v2->v_type != V_STR ||
|
||||||
|
v3->v_type != V_NUM || qisneg(v3->v_num) ||
|
||||||
|
qisfrac(v3->v_num) || zge31b(v3->v_num->num))
|
||||||
|
return error_value(E_STRNCASECMP);
|
||||||
|
n1 = v1->v_str->s_len;
|
||||||
|
n2 = v2->v_str->s_len;
|
||||||
|
n = qtoi(v3->v_num);
|
||||||
|
if (n < n1)
|
||||||
|
v1->v_str->s_len = n;
|
||||||
|
if (n < n2)
|
||||||
|
v2->v_str->s_len = n;
|
||||||
|
|
||||||
|
flag = stringcaserel(v1->v_str, v2->v_str);
|
||||||
|
|
||||||
|
v1->v_str->s_len = n1;
|
||||||
|
v2->v_str->s_len = n2;
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq((long) flag);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
S_FUNC VALUE
|
S_FUNC VALUE
|
||||||
f_strcat(int count, VALUE **vals)
|
f_strcat(int count, VALUE **vals)
|
||||||
@@ -4394,6 +4444,307 @@ f_ord(VALUE *vp)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isupper(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISUPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isupper( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_islower(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISLOWER);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (islower( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isalnum(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISALNUM);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isalnum( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isalpha(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISALPHA);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isalpha( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* Not in C-standard, marked as obsolete in POSIX.1-2008 */
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isascii(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISASCII);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isascii( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif /* 0 */
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_iscntrl(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISCNTRL);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (iscntrl( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isdigit(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISDIGIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isdigit( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isgraph(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISGRAPH);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isgraph( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isprint(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISPRINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isprint( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_ispunct(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISPUNCT);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (ispunct( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isspace(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISSPACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isspace( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
S_FUNC VALUE
|
||||||
|
f_isxdigit(VALUE *vp)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
/* initialize VALUE */
|
||||||
|
result.v_subtype = V_NOSUBTYPE;
|
||||||
|
|
||||||
|
switch(vp->v_type) {
|
||||||
|
case V_STR:
|
||||||
|
c = *vp->v_str->s_str;
|
||||||
|
break;
|
||||||
|
case V_OCTET:
|
||||||
|
c = *vp->v_octet;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return error_value(E_ISXDIGIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.v_type = V_NUM;
|
||||||
|
result.v_num = itoq( (isxdigit( c ))?1l:0l);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
S_FUNC VALUE
|
S_FUNC VALUE
|
||||||
f_protect(int count, VALUE **vals)
|
f_protect(int count, VALUE **vals)
|
||||||
@@ -4842,7 +5193,8 @@ f_rsearch(int count, VALUE **vals)
|
|||||||
i = listrsearch(v1->v_list, v2, l_start, l_end, &indx);
|
i = listrsearch(v1->v_list, v2, l_start, l_end, &indx);
|
||||||
break;
|
break;
|
||||||
case V_ASSOC:
|
case V_ASSOC:
|
||||||
i = assocrsearch(v1->v_assoc, v2, l_start, l_end, &indx);
|
i = assocrsearch(v1->v_assoc, v2, l_start,
|
||||||
|
l_end, &indx);
|
||||||
break;
|
break;
|
||||||
case V_STR:
|
case V_STR:
|
||||||
i = stringrsearch(v1->v_str, v2->v_str, l_start,
|
i = stringrsearch(v1->v_str, v2->v_str, l_start,
|
||||||
@@ -8130,7 +8482,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"ceil", 1, 1, 0, OP_NOP, 0, f_ceil,
|
{"ceil", 1, 1, 0, OP_NOP, 0, f_ceil,
|
||||||
"smallest integer greater than or equal to number"},
|
"smallest integer greater than or equal to number"},
|
||||||
{"cfappr", 1, 3, 0, OP_NOP, f_cfappr, 0,
|
{"cfappr", 1, 3, 0, OP_NOP, f_cfappr, 0,
|
||||||
"approximate a within accuracy b using\n\t\t\tcontinued fractions"},
|
"approximate a within accuracy b using\n"
|
||||||
|
"\t\t\tcontinued fractions"},
|
||||||
{"cfsim", 1, 2, 0, OP_NOP, f_cfsim, 0,
|
{"cfsim", 1, 2, 0, OP_NOP, f_cfsim, 0,
|
||||||
"simplify number using continued fractions"},
|
"simplify number using continued fractions"},
|
||||||
{"char", 1, 1, 0, OP_NOP, 0, f_char,
|
{"char", 1, 1, 0, OP_NOP, 0, f_char,
|
||||||
@@ -8230,7 +8583,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"fgets", 1, 1, 0, OP_NOP, 0, f_fgets,
|
{"fgets", 1, 1, 0, OP_NOP, 0, f_fgets,
|
||||||
"read next line from file, newline is kept"},
|
"read next line from file, newline is kept"},
|
||||||
{"fgetstr", 1, 1, 0, OP_NOP, 0, f_fgetstr,
|
{"fgetstr", 1, 1, 0, OP_NOP, 0, f_fgetstr,
|
||||||
"read next null-terminated string from file, null\n\t\t\tcharacter is kept"},
|
"read next null-terminated string from file, null\n"
|
||||||
|
"\t\t\tcharacter is kept"},
|
||||||
{"files", 0, 1, 0, OP_NOP, 0, f_files,
|
{"files", 0, 1, 0, OP_NOP, 0, f_files,
|
||||||
"return opened file or max number of opened files"},
|
"return opened file or max number of opened files"},
|
||||||
{"floor", 1, 1, 0, OP_NOP, 0, f_floor,
|
{"floor", 1, 1, 0, OP_NOP, 0, f_floor,
|
||||||
@@ -8238,7 +8592,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"fopen", 2, 2, 0, OP_NOP, 0, f_fopen,
|
{"fopen", 2, 2, 0, OP_NOP, 0, f_fopen,
|
||||||
"open file name a in mode b"},
|
"open file name a in mode b"},
|
||||||
{"fpathopen", 2, 3, 0, OP_NOP, 0, f_fpathopen,
|
{"fpathopen", 2, 3, 0, OP_NOP, 0, f_fpathopen,
|
||||||
"open file name a in mode b, search for a along\n\t\t\tCALCPATH or path c"},
|
"open file name a in mode b, search for a along\n"
|
||||||
|
"\t\t\tCALCPATH or path c"},
|
||||||
{"fprintf", 2, IN, 0, OP_NOP, 0, f_fprintf,
|
{"fprintf", 2, IN, 0, OP_NOP, 0, f_fprintf,
|
||||||
"print formatted output to opened file"},
|
"print formatted output to opened file"},
|
||||||
{"fputc", 2, 2, 0, OP_NOP, 0, f_fputc,
|
{"fputc", 2, 2, 0, OP_NOP, 0, f_fputc,
|
||||||
@@ -8262,9 +8617,11 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"freopen", 2, 3, 0, OP_NOP, 0, f_freopen,
|
{"freopen", 2, 3, 0, OP_NOP, 0, f_freopen,
|
||||||
"reopen a file stream to a named file"},
|
"reopen a file stream to a named file"},
|
||||||
{"fscan", 2, IN, FA, OP_NOP, 0, f_fscan,
|
{"fscan", 2, IN, FA, OP_NOP, 0, f_fscan,
|
||||||
"scan a file for assignments to one or\n\t\t\tmore variables"},
|
"scan a file for assignments to one or\n"
|
||||||
|
"\t\t\tmore variables"},
|
||||||
{"fscanf", 2, IN, FA, OP_NOP, 0, f_fscanf,
|
{"fscanf", 2, IN, FA, OP_NOP, 0, f_fscanf,
|
||||||
"formatted scan of a file for assignment to one\n\t\t\tor more variables"},
|
"formatted scan of a file for assignment to one\n"
|
||||||
|
"\t\t\tor more variables"},
|
||||||
{"fseek", 2, 3, 0, OP_NOP, 0, f_fseek,
|
{"fseek", 2, 3, 0, OP_NOP, 0, f_fseek,
|
||||||
"seek to position b (offset from c) in file a"},
|
"seek to position b (offset from c) in file a"},
|
||||||
{"fsize", 1, 1, 0, OP_NOP, 0, f_fsize,
|
{"fsize", 1, 1, 0, OP_NOP, 0, f_fsize,
|
||||||
@@ -8282,7 +8639,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"getenv", 1, 1, 0, OP_NOP, 0, f_getenv,
|
{"getenv", 1, 1, 0, OP_NOP, 0, f_getenv,
|
||||||
"value of environment variable (or NULL)"},
|
"value of environment variable (or NULL)"},
|
||||||
{"hash", 1, IN, 0, OP_NOP, 0, f_hash,
|
{"hash", 1, IN, 0, OP_NOP, 0, f_hash,
|
||||||
"return non-negative hash value for one or\n\t\t\tmore values"},
|
"return non-negative hash value for one or\n"
|
||||||
|
"\t\t\tmore values"},
|
||||||
{"head", 2, 2, 0, OP_NOP, 0, f_head,
|
{"head", 2, 2, 0, OP_NOP, 0, f_head,
|
||||||
"return list of specified number at head of a list"},
|
"return list of specified number at head of a list"},
|
||||||
{"highbit", 1, 1, 0, OP_HIGHBIT, 0, 0,
|
{"highbit", 1, 1, 0, OP_HIGHBIT, 0, 0,
|
||||||
@@ -8376,7 +8734,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"istype", 2, 2, 0, OP_ISTYPE, 0, 0,
|
{"istype", 2, 2, 0, OP_ISTYPE, 0, 0,
|
||||||
"whether the type of a is same as the type of b"},
|
"whether the type of a is same as the type of b"},
|
||||||
{"jacobi", 2, 2, 0, OP_NOP, qjacobi, 0,
|
{"jacobi", 2, 2, 0, OP_NOP, qjacobi, 0,
|
||||||
"-1 => a is not quadratic residue mod b\n\t\t\t1 => b is composite, or a is quad residue of b"},
|
"-1 => a is not quadratic residue mod b\n"
|
||||||
|
"\t\t\t1 => b is composite, or a is quad residue of b"},
|
||||||
{"join", 1, IN, 0, OP_NOP, 0, f_join,
|
{"join", 1, IN, 0, OP_NOP, 0, f_join,
|
||||||
"join one or more lists into one list"},
|
"join one or more lists into one list"},
|
||||||
{"lcm", 1, IN, 0, OP_NOP, f_lcm, 0,
|
{"lcm", 1, IN, 0, OP_NOP, f_lcm, 0,
|
||||||
@@ -8449,8 +8808,31 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
"numerator of fraction"},
|
"numerator of fraction"},
|
||||||
{"ord", 1, 1, 0, OP_NOP, 0, f_ord,
|
{"ord", 1, 1, 0, OP_NOP, 0, f_ord,
|
||||||
"integer corresponding to character value"},
|
"integer corresponding to character value"},
|
||||||
|
{"isupper", 1, 1, 0, OP_NOP, 0, f_isupper,
|
||||||
|
"whether character is upper case"},
|
||||||
|
{"islower", 1, 1, 0, OP_NOP, 0, f_islower,
|
||||||
|
"whether character is lower case"},
|
||||||
|
{"isalnum", 1, 1, 0, OP_NOP, 0, f_isalnum,
|
||||||
|
"whether character is alpha-numeric"},
|
||||||
|
{"isalpha", 1, 1, 0, OP_NOP, 0, f_isalpha,
|
||||||
|
"whether character is alphabetic"},
|
||||||
|
{"iscntrl", 1, 1, 0, OP_NOP, 0, f_iscntrl,
|
||||||
|
"whether character is a control character"},
|
||||||
|
{"isdigit", 1, 1, 0, OP_NOP, 0, f_isdigit,
|
||||||
|
"whether character is a digit"},
|
||||||
|
{"isgraph", 1, 1, 0, OP_NOP, 0, f_isgraph,
|
||||||
|
"whether character is a graphical character"},
|
||||||
|
{"isprint", 1, 1, 0, OP_NOP, 0, f_isprint,
|
||||||
|
"whether character is printable"},
|
||||||
|
{"ispunct", 1, 1, 0, OP_NOP, 0, f_ispunct,
|
||||||
|
"whether character is a punctuation"},
|
||||||
|
{"isspace", 1, 1, 0, OP_NOP, 0, f_isspace,
|
||||||
|
"whether character is a space character"},
|
||||||
|
{"isxdigit", 1, 1, 0, OP_NOP, 0, f_isxdigit,
|
||||||
|
"whether character is a hexadecimal digit"},
|
||||||
{"param", 1, 1, 0, OP_ARGVALUE, 0, 0,
|
{"param", 1, 1, 0, OP_ARGVALUE, 0, 0,
|
||||||
"value of parameter n (or parameter count if n\n\t\t\tis zero)"},
|
"value of parameter n (or parameter count if n\n"
|
||||||
|
"\t\t\tis zero)"},
|
||||||
{"perm", 2, 2, 0, OP_NOP, qperm, 0,
|
{"perm", 2, 2, 0, OP_NOP, qperm, 0,
|
||||||
"permutation number a!/(a-b)!"},
|
"permutation number a!/(a-b)!"},
|
||||||
{"prevcand", 1, 5, 0, OP_NOP, f_prevcand, 0,
|
{"prevcand", 1, 5, 0, OP_NOP, f_prevcand, 0,
|
||||||
@@ -8470,7 +8852,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"polar", 2, 3, 0, OP_NOP, 0, f_polar,
|
{"polar", 2, 3, 0, OP_NOP, 0, f_polar,
|
||||||
"complex value of polar coordinate (a * exp(b*1i))"},
|
"complex value of polar coordinate (a * exp(b*1i))"},
|
||||||
{"poly", 1, IN, 0, OP_NOP, 0, f_poly,
|
{"poly", 1, IN, 0, OP_NOP, 0, f_poly,
|
||||||
"evaluates a polynomial given its coefficients\n\t\t\tor coefficient-list"},
|
"evaluates a polynomial given its coefficients\n"
|
||||||
|
"\t\t\tor coefficient-list"},
|
||||||
{"pop", 1, 1, FA, OP_NOP, 0, f_listpop,
|
{"pop", 1, 1, FA, OP_NOP, 0, f_listpop,
|
||||||
"pop value from front of list"},
|
"pop value from front of list"},
|
||||||
{"popcnt", 1, 2, 0, OP_NOP, f_popcnt, 0,
|
{"popcnt", 1, 2, 0, OP_NOP, f_popcnt, 0,
|
||||||
@@ -8492,7 +8875,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"quo", 2, 3, 0, OP_NOP, 0, f_quo,
|
{"quo", 2, 3, 0, OP_NOP, 0, f_quo,
|
||||||
"integer quotient of a by b, rounding type c"},
|
"integer quotient of a by b, rounding type c"},
|
||||||
{"quomod", 4, 5, FA, OP_NOP, 0, f_quomod,
|
{"quomod", 4, 5, FA, OP_NOP, 0, f_quomod,
|
||||||
"set c and d to quotient and remainder of a\n\t\t\tdivided by b"},
|
"set c and d to quotient and remainder of a\n"
|
||||||
|
"\t\t\tdivided by b"},
|
||||||
{"rand", 0, 2, 0, OP_NOP, f_rand, 0,
|
{"rand", 0, 2, 0, OP_NOP, f_rand, 0,
|
||||||
"additive 55 random number [0,2^64), [0,a), or [a,b)"},
|
"additive 55 random number [0,2^64), [0,a), or [a,b)"},
|
||||||
{"randbit", 0, 1, 0, OP_NOP, f_randbit, 0,
|
{"randbit", 0, 1, 0, OP_NOP, f_randbit, 0,
|
||||||
@@ -8528,7 +8912,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"round", 1, 3, 0, OP_NOP, 0, f_round,
|
{"round", 1, 3, 0, OP_NOP, 0, f_round,
|
||||||
"round value a to b number of decimal places"},
|
"round value a to b number of decimal places"},
|
||||||
{"rsearch", 2, 4, 0, OP_NOP, 0, f_rsearch,
|
{"rsearch", 2, 4, 0, OP_NOP, 0, f_rsearch,
|
||||||
"reverse search matrix or list for value b\n\t\t\tstarting at index c"},
|
"reverse search matrix or list for value b\n"
|
||||||
|
"\t\t\tstarting at index c"},
|
||||||
{"runtime", 0, 0, 0, OP_NOP, f_runtime, 0,
|
{"runtime", 0, 0, 0, OP_NOP, f_runtime, 0,
|
||||||
"user and kernel mode cpu time in seconds"},
|
"user and kernel mode cpu time in seconds"},
|
||||||
{"saveval", 1, 1, 0, OP_SAVEVAL, 0, 0,
|
{"saveval", 1, 1, 0, OP_SAVEVAL, 0, 0,
|
||||||
@@ -8536,11 +8921,14 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
{"scale", 2, 2, 0, OP_SCALE, 0, 0,
|
{"scale", 2, 2, 0, OP_SCALE, 0, 0,
|
||||||
"scale value up or down by a power of two"},
|
"scale value up or down by a power of two"},
|
||||||
{"scan", 1, IN, FA, OP_NOP, 0, f_scan,
|
{"scan", 1, IN, FA, OP_NOP, 0, f_scan,
|
||||||
"scan standard input for assignment to one\n\t\t\tor more variables"},
|
"scan standard input for assignment to one\n"
|
||||||
|
"\t\t\tor more variables"},
|
||||||
{"scanf", 2, IN, FA, OP_NOP, 0, f_scanf,
|
{"scanf", 2, IN, FA, OP_NOP, 0, f_scanf,
|
||||||
"formatted scan of standard input for assignment\n\t\t\tto variables"},
|
"formatted scan of standard input for assignment\n"
|
||||||
|
"\t\t\tto variables"},
|
||||||
{"search", 2, 4, 0, OP_NOP, 0, f_search,
|
{"search", 2, 4, 0, OP_NOP, 0, f_search,
|
||||||
"search matrix or list for value b starting\n\t\t\tat index c"},
|
"search matrix or list for value b starting\n"
|
||||||
|
"\t\t\tat index c"},
|
||||||
{"sec", 1, 2, 0, OP_NOP, 0, f_sec,
|
{"sec", 1, 2, 0, OP_NOP, 0, f_sec,
|
||||||
"sec of a within accuracy b"},
|
"sec of a within accuracy b"},
|
||||||
{"sech", 1, 2, 0, OP_NOP, 0, f_sech,
|
{"sech", 1, 2, 0, OP_NOP, 0, f_sech,
|
||||||
@@ -8585,6 +8973,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
"concatenate strings together"},
|
"concatenate strings together"},
|
||||||
{"strcmp", 2, 2, 0, OP_NOP, 0, f_strcmp,
|
{"strcmp", 2, 2, 0, OP_NOP, 0, f_strcmp,
|
||||||
"compare two strings"},
|
"compare two strings"},
|
||||||
|
{"strcasecmp", 2, 2, 0, OP_NOP, 0, f_strcasecmp,
|
||||||
|
"compare two strings case independent"},
|
||||||
{"strcpy", 2, 2, 0, OP_NOP, 0, f_strcpy,
|
{"strcpy", 2, 2, 0, OP_NOP, 0, f_strcpy,
|
||||||
"copy string to string"},
|
"copy string to string"},
|
||||||
{"strerror", 0, 1, 0, OP_NOP, 0, f_strerror,
|
{"strerror", 0, 1, 0, OP_NOP, 0, f_strerror,
|
||||||
@@ -8593,6 +8983,8 @@ STATIC CONST struct builtin builtins[] = {
|
|||||||
"length of string"},
|
"length of string"},
|
||||||
{"strncmp", 3, 3, 0, OP_NOP, 0, f_strncmp,
|
{"strncmp", 3, 3, 0, OP_NOP, 0, f_strncmp,
|
||||||
"compare strings a, b to c characters"},
|
"compare strings a, b to c characters"},
|
||||||
|
{"strncasecmp", 3, 3, 0, OP_NOP, 0, f_strncasecmp,
|
||||||
|
"compare strings a, b to c characters case independent"},
|
||||||
{"strncpy", 3, 3, 0, OP_NOP, 0, f_strncpy,
|
{"strncpy", 3, 3, 0, OP_NOP, 0, f_strncpy,
|
||||||
"copy up to c characters from string to string"},
|
"copy up to c characters from string to string"},
|
||||||
{"strpos", 2, 2, 0, OP_NOP, 0, f_strpos,
|
{"strpos", 2, 2, 0, OP_NOP, 0, f_strpos,
|
||||||
@@ -8775,7 +9167,8 @@ builtinfunc(long index, int argcount, VALUE *stck)
|
|||||||
vpp = valargs;
|
vpp = valargs;
|
||||||
for (i = 0; i < argcount; i++) {
|
for (i = 0; i < argcount; i++) {
|
||||||
if ((*vpp)->v_type != V_NUM) {
|
if ((*vpp)->v_type != V_NUM) {
|
||||||
math_error("Non-real argument for builtin function %s", bp->b_name);
|
math_error("Non-real argument for builtin function %s",
|
||||||
|
bp->b_name);
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
numargs[i] = (*vpp)->v_num;
|
numargs[i] = (*vpp)->v_num;
|
||||||
|
7
hash.c
7
hash.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: hash.c,v 30.2 2007/07/05 17:37:41 chongo Exp $
|
* @(#) $Id: hash.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/hash.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/hash.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/11/23 05:13:11
|
* Under source code control: 1995/11/23 05:13:11
|
||||||
@@ -848,7 +848,8 @@ hash_value(int type, void *v, HASH *state)
|
|||||||
value->v_obj->o_actions->oa_index), state);
|
value->v_obj->o_actions->oa_index), state);
|
||||||
(state->chkpt)(state);
|
(state->chkpt)(state);
|
||||||
|
|
||||||
for (i=value->v_obj->o_actions->oa_count, vp=value->v_obj->o_table;
|
for (i=value->v_obj->o_actions->oa_count,
|
||||||
|
vp=value->v_obj->o_table;
|
||||||
i-- > 0;
|
i-- > 0;
|
||||||
vp++) {
|
vp++) {
|
||||||
|
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: have_posscl.c,v 30.2 2008/04/15 21:17:57 chongo Exp $
|
* @(#) $Id: have_posscl.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_posscl.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_posscl.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1996/07/13 12:57:22
|
* Under source code control: 1996/07/13 12:57:22
|
||||||
@@ -85,7 +85,8 @@ main(void)
|
|||||||
printf("#undef HAVE_FILEPOS_SCALAR\n");
|
printf("#undef HAVE_FILEPOS_SCALAR\n");
|
||||||
printf("#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */\n");
|
printf("#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */\n");
|
||||||
#else
|
#else
|
||||||
printf("#undef HAVE_FILEPOS_SCALAR /* FILEPOS is not a simple value */\n");
|
printf("#undef HAVE_FILEPOS_SCALAR "
|
||||||
|
"/* FILEPOS is not a simple value */\n");
|
||||||
#endif
|
#endif
|
||||||
/* exit(0); */
|
/* exit(0); */
|
||||||
return 0;
|
return 0;
|
||||||
|
16
have_stdvs.c
16
have_stdvs.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: have_stdvs.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: have_stdvs.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_stdvs.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_stdvs.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/09/09 22:41:10
|
* Under source code control: 1995/09/09 22:41:10
|
||||||
@@ -57,7 +57,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef VSPRINTF_SIZE_T
|
#undef VSPRINTF_SIZE_T
|
||||||
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \
|
||||||
|
defined(__cplusplus)
|
||||||
# define VSPRINTF_SIZE_T size_t
|
# define VSPRINTF_SIZE_T size_t
|
||||||
#else
|
#else
|
||||||
# define VSPRINTF_SIZE_T long
|
# define VSPRINTF_SIZE_T long
|
||||||
@@ -160,8 +161,10 @@ main(void)
|
|||||||
puts("/*");
|
puts("/*");
|
||||||
puts(" * SIMULATE_STDARG");
|
puts(" * SIMULATE_STDARG");
|
||||||
puts(" *");
|
puts(" *");
|
||||||
puts(" * WARNING: This type of stdarg makes assumptions about the stack");
|
puts(" * WARNING: This type of stdarg makes assumptions "
|
||||||
puts(" * that may not be true on your system. You may want to");
|
"about the stack");
|
||||||
|
puts(" * that may not be true on your system. "
|
||||||
|
"You may want to");
|
||||||
puts(" * define STDARG (if using ANSI C) or VARARGS.");
|
puts(" * define STDARG (if using ANSI C) or VARARGS.");
|
||||||
puts(" */");
|
puts(" */");
|
||||||
puts("typedef char *va_list;");
|
puts("typedef char *va_list;");
|
||||||
@@ -169,7 +172,8 @@ main(void)
|
|||||||
puts("#define va_end(ap) (void)((ap) = 0)");
|
puts("#define va_end(ap) (void)((ap) = 0)");
|
||||||
puts("#define va_arg(ap, type) \\");
|
puts("#define va_arg(ap, type) \\");
|
||||||
puts(" (((type*)((ap) = ((ap) + sizeof(type))))[-1])");
|
puts(" (((type*)((ap) = ((ap) + sizeof(type))))[-1])");
|
||||||
puts("#define SIMULATE_STDARG /* use std_arg.h to simulate <stdarg.h> */");
|
puts("#define SIMULATE_STDARG "
|
||||||
|
"/* use std_arg.h to simulate <stdarg.h> */");
|
||||||
#else
|
#else
|
||||||
puts("#define STDARG /* use <stdarg.h> */");
|
puts("#define STDARG /* use <stdarg.h> */");
|
||||||
puts("#include <stdarg.h>");
|
puts("#include <stdarg.h>");
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.1 $
|
* @(#) $Revision: 30.2 $
|
||||||
* @(#) $Id: have_varvs.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
* @(#) $Id: have_varvs.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_varvs.c,v $
|
* @(#) $Source: /usr/local/src/bin/calc/RCS/have_varvs.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/09/09 22:41:10
|
* Under source code control: 1995/09/09 22:41:10
|
||||||
@@ -53,7 +53,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef VSPRINTF_SIZE_T
|
#undef VSPRINTF_SIZE_T
|
||||||
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \
|
||||||
|
defined(__cplusplus)
|
||||||
# define VSPRINTF_SIZE_T size_t
|
# define VSPRINTF_SIZE_T size_t
|
||||||
#else
|
#else
|
||||||
# define VSPRINTF_SIZE_T long
|
# define VSPRINTF_SIZE_T long
|
||||||
|
8
help.c
8
help.c
@@ -17,9 +17,9 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 30.2 $
|
* @(#) $Revision: 30.3 $
|
||||||
* @(#) $Id: help.c,v 30.2 2007/09/21 01:27:27 chongo Exp $
|
* @(#) $Id: help.c,v 30.3 2013/08/11 01:08:32 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/help.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/09/14 10:58:30
|
* Under source code control: 1997/09/14 10:58:30
|
||||||
* File existed as early as: 1997
|
* File existed as early as: 1997
|
||||||
@@ -274,7 +274,7 @@ givehelp(char *type)
|
|||||||
|
|
||||||
#if defined(CUSTOM)
|
#if defined(CUSTOM)
|
||||||
/*
|
/*
|
||||||
* open the the helpfile (looking in CUSTOMHELPDIR last)
|
* open the helpfile (looking in CUSTOMHELPDIR last)
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 30.5 $
|
# @(#) $Revision: 30.6 $
|
||||||
# @(#) $Id: Makefile,v 30.5 2007/09/21 01:27:27 chongo Exp $
|
# @(#) $Id: Makefile,v 30.6 2013/09/01 18:37:27 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1991/07/23 06:47:57
|
# Under source code control: 1991/07/23 06:47:57
|
||||||
@@ -292,20 +292,20 @@ DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \
|
|||||||
floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \
|
floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \
|
||||||
freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \
|
freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \
|
||||||
fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \
|
fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \
|
||||||
hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert int \
|
hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert \
|
||||||
inverse iroot isassoc isatty isblk isconfig isdefined iserror iseven \
|
int inverse iroot isassoc isatty isblk isconfig isdefined iserror \
|
||||||
isfile ishash isident isint islist ismat ismult isnull isnum isobj \
|
iseven isfile ishash isident isint islist ismat ismult isnull isnum \
|
||||||
isobjtype isodd isprime isptr isqrt isrand israndom isreal isrel \
|
isobj isobjtype isodd isprime isptr isqrt isrand israndom isreal \
|
||||||
issimple issq isstr istype jacobi join lcm lcmfact lfactor ln log \
|
isrel issimple issq isstr istype jacobi join lcm lcmfact lfactor \
|
||||||
lowbit ltol makelist matdim matfill matmax matmin matsum mattrace \
|
ln log lowbit ltol makelist matdim matfill matmax matmin matsum \
|
||||||
mattrans max memsize meq min minv mmin mne mod modify name near \
|
mattrace mattrans max memsize meq min minv mmin mne mod modify \
|
||||||
newerror nextcand nextprime norm null num oldvalue ord param perm \
|
name near newerror nextcand nextprime norm null num oldvalue ord \
|
||||||
pfact pi pix places pmod polar poly pop popcnt pound power prevcand \
|
param perm pfact pi pix places pmod polar poly pop popcnt pound \
|
||||||
prevprime printf prompt protect ptest push putenv quo quomod rand \
|
power prevcand prevprime printf prompt protect ptest push putenv \
|
||||||
randbit random randombit randperm rcin rcmul rcout rcpow rcsq re \
|
quo quomod rand randbit random randombit randperm rcin rcmul rcout \
|
||||||
remove reverse rewind rm root round rsearch runtime saveval scale \
|
rcpow rcsq re remove reverse rewind rm root round rsearch runtime \
|
||||||
scan scanf search sec sech seed segment select sgn sha1 sin \
|
saveval scale scan scanf search sec sech seed segment select sgn sha1 \
|
||||||
sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \
|
sin sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \
|
||||||
str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \
|
str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \
|
||||||
strprintf strscan strscanf substr sum swap system systime tail tan \
|
strprintf strscan strscanf substr sum swap system systime tail tan \
|
||||||
tanh test time trunc usertime version xor
|
tanh test time trunc usertime version xor
|
||||||
|
2
help/abs
2
help/abs
@@ -62,7 +62,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: abs,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: abs,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/abs,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/abs,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:22
|
## Under source code control: 1994/03/19 01:40:22
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -66,7 +66,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: access,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: access,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/access,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/access,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1996/04/30 03:36:20
|
## Under source code control: 1996/04/30 03:36:20
|
||||||
## File existed as early as: 1996
|
## File existed as early as: 1996
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acos,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acos,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acos,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acos,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:23
|
## Under source code control: 1994/03/19 01:40:23
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -50,7 +50,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acosh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acosh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acosh,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acosh,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:24
|
## Under source code control: 1994/03/19 01:40:24
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acot,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acot,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acot,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acot,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:00
|
## Under source code control: 1995/11/13 03:49:00
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -49,7 +49,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acoth,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acoth,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acoth,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acoth,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:01
|
## Under source code control: 1995/11/13 03:49:01
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acsc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acsc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acsc,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsc,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:00
|
## Under source code control: 1995/11/13 03:49:00
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -50,7 +50,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: acsch,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: acsch,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acsch,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsch,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:01
|
## Under source code control: 1995/11/13 03:49:01
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -178,7 +178,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: address,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: address,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/address,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/address,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/09/06 20:03:34
|
## Under source code control: 1997/09/06 20:03:34
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
2
help/agd
2
help/agd
@@ -74,7 +74,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: agd,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: agd,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/agd,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/agd,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/09/06 20:03:34
|
## Under source code control: 1997/09/06 20:03:34
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -78,7 +78,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: append,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: append,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/append,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/append,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 03:13:17
|
## Under source code control: 1994/03/19 03:13:17
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -169,7 +169,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: appr,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: appr,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/appr,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/appr,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/25 17:18:21
|
## Under source code control: 1994/09/25 17:18:21
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Where to get the the latest versions of calc
|
Where to get the latest versions of calc
|
||||||
|
|
||||||
Landon Noll maintains the official calc home page at:
|
Landon Noll maintains the official calc home page at:
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ chongo <was here> /\../\
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.2 $
|
||||||
## @(#) $Id: archive,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: archive,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/archive,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/archive,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1996/06/13 02:51:48
|
## Under source code control: 1996/06/13 02:51:48
|
||||||
## File existed as early as: 1996
|
## File existed as early as: 1996
|
||||||
|
2
help/arg
2
help/arg
@@ -50,7 +50,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: arg,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: arg,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/arg,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arg,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/25 20:22:31
|
## Under source code control: 1994/09/25 20:22:31
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -71,7 +71,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: argv,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: argv,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/argv,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/argv,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1999/11/23 19:45:05
|
## Under source code control: 1999/11/23 19:45:05
|
||||||
## File existed as early as: 1999
|
## File existed as early as: 1999
|
||||||
|
@@ -68,7 +68,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: arrow,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: arrow,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/arrow,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arrow,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/09/06 20:03:34
|
## Under source code control: 1997/09/06 20:03:34
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: asec,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: asec,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asec,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asec,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:00
|
## Under source code control: 1995/11/13 03:49:00
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -49,7 +49,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: asech,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: asech,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asech,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asech,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/11/13 03:49:00
|
## Under source code control: 1995/11/13 03:49:00
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: asin,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: asin,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asin,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asin,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:24
|
## Under source code control: 1994/03/19 01:40:24
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -49,7 +49,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: asinh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: asinh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asinh,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asinh,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:25
|
## Under source code control: 1994/03/19 01:40:25
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -135,7 +135,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: assign,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: assign,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/assign,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assign,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/05/11 21:03:23
|
## Under source code control: 1995/05/11 21:03:23
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -100,7 +100,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: assoc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: assoc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/assoc,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assoc,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/25 20:22:31
|
## Under source code control: 1994/09/25 20:22:31
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: atan,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: atan,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atan,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:25
|
## Under source code control: 1994/03/19 01:40:25
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -54,7 +54,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: atan2,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: atan2,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atan2,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan2,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:26
|
## Under source code control: 1994/03/19 01:40:26
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -49,7 +49,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: atanh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: atanh,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atanh,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atanh,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:27
|
## Under source code control: 1994/03/19 01:40:27
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
2
help/avg
2
help/avg
@@ -67,7 +67,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: avg,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: avg,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/avg,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/avg,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/25 20:22:31
|
## Under source code control: 1994/09/25 20:22:31
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -99,7 +99,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: base,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: base,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/base,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/30 00:09:39
|
## Under source code control: 1994/09/30 00:09:39
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -111,7 +111,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: base2,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: base2,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/base2,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base2,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2002/12/29 00:21:07
|
## Under source code control: 2002/12/29 00:21:07
|
||||||
## File existed as early as: 2002
|
## File existed as early as: 2002
|
||||||
|
@@ -59,7 +59,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: bernoulli,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: bernoulli,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bernoulli,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bernoulli,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2000/07/13 01:33:00
|
## Under source code control: 2000/07/13 01:33:00
|
||||||
## File existed as early as: 2000
|
## File existed as early as: 2000
|
||||||
|
2
help/bit
2
help/bit
@@ -60,7 +60,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: bit,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: bit,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bit,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bit,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/10/21 02:21:30
|
## Under source code control: 1994/10/21 02:21:30
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
2
help/blk
2
help/blk
@@ -251,7 +251,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: blk,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: blk,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blk,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blk,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 13:07:13
|
## Under source code control: 1997/04/05 13:07:13
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -86,7 +86,7 @@ DESCRIPTION
|
|||||||
; blkcpy(L, M);
|
; blkcpy(L, M);
|
||||||
|
|
||||||
For copying from a block B (named or unnamed), the total number of octets
|
For copying from a block B (named or unnamed), the total number of octets
|
||||||
available for copying is taken to the the datalen for that block,
|
available for copying is taken to the datalen for that block,
|
||||||
so that num can be at most size(B) - ssi.
|
so that num can be at most size(B) - ssi.
|
||||||
|
|
||||||
For copying to a block B (named or unnamed), reallocation will be
|
For copying to a block B (named or unnamed), reallocation will be
|
||||||
@@ -206,9 +206,9 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.2 $
|
||||||
## @(#) $Id: blkcpy,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: blkcpy,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blkcpy,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkcpy,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 14:08:50
|
## Under source code control: 1997/04/05 14:08:50
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -75,7 +75,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: blkfree,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: blkfree,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blkfree,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkfree,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 13:07:13
|
## Under source code control: 1997/04/05 13:07:13
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -60,7 +60,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: blocks,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: blocks,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blocks,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blocks,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 13:07:13
|
## Under source code control: 1997/04/05 13:07:13
|
||||||
## File existed as early as: 1997
|
## File existed as early as: 1997
|
||||||
|
@@ -140,7 +140,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: bround,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: bround,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bround,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bround,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/30 00:22:35
|
## Under source code control: 1994/09/30 00:22:35
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -61,7 +61,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: btrunc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: btrunc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/btrunc,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/btrunc,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/30 00:44:27
|
## Under source code control: 1994/09/30 00:44:27
|
||||||
## File existed as early as: 1994
|
## File existed as early as: 1994
|
||||||
|
@@ -217,7 +217,7 @@
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: builtin.end,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: builtin.end,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/builtin.end,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.end,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/07/10 01:17:53
|
## Under source code control: 1995/07/10 01:17:53
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -25,7 +25,7 @@ Builtin functions
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: builtin.top,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: builtin.top,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/builtin.top,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.top,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/07/10 01:17:53
|
## Under source code control: 1995/07/10 01:17:53
|
||||||
## File existed as early as: 1995
|
## File existed as early as: 1995
|
||||||
|
@@ -44,7 +44,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: calc_tty,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: calc_tty,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calc_tty,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calc_tty,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2000/12/14 01:33:00
|
## Under source code control: 2000/12/14 01:33:00
|
||||||
## File existed as early as: 2000
|
## File existed as early as: 2000
|
||||||
|
@@ -52,7 +52,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: calclevel,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: calclevel,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calclevel,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calclevel,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1999/10/31 06:01:21
|
## Under source code control: 1999/10/31 06:01:21
|
||||||
## File existed as early as: 1999
|
## File existed as early as: 1999
|
||||||
|
@@ -47,7 +47,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: calcpath,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: calcpath,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calcpath,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calcpath,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2006/05/07 23:56:04
|
## Under source code control: 2006/05/07 23:56:04
|
||||||
## File existed as early as: 2006
|
## File existed as early as: 2006
|
||||||
|
@@ -55,7 +55,7 @@ SEE ALSO
|
|||||||
##
|
##
|
||||||
## @(#) $Revision: 30.1 $
|
## @(#) $Revision: 30.1 $
|
||||||
## @(#) $Id: catalan,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
## @(#) $Id: catalan,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/catalan,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/catalan,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2000/12/14 01:33:00
|
## Under source code control: 2000/12/14 01:33:00
|
||||||
## File existed as early as: 2000
|
## File existed as early as: 2000
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user