mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.11.0t10
This commit is contained in:
@@ -6,7 +6,7 @@ Step 0: Determine if is should it be done?
|
||||
multi-precision calculations in a C-like environment. You should
|
||||
consider implementing algorithms in the calc language as a first
|
||||
choice. Sometimes an algorithm requires use of special hardware, a
|
||||
non-portable OS or pre-compiled C library. In these cases a custom
|
||||
non-portable OS or pre-compiled C library. In these cases a custom
|
||||
interface may be needed.
|
||||
|
||||
The custom function interface is intended to make is easy for
|
||||
@@ -184,7 +184,7 @@ Step 5: Write your custom function
|
||||
The 3 args are passed in by the custom interface
|
||||
and have the following meaning:
|
||||
|
||||
name The name of the custom function that
|
||||
name The name of the custom function that
|
||||
was called. In particular, this is the first
|
||||
string arg that was given to the custom()
|
||||
builtin. This is the equivalent of argv[0] for
|
||||
@@ -215,11 +215,11 @@ Step 5: Write your custom function
|
||||
|
||||
custom("curds", a, b, c)
|
||||
|
||||
would cause vals to point to the following array:
|
||||
would cause vals to point to the following array:
|
||||
|
||||
vals[0] points to a
|
||||
vals[1] points to b
|
||||
vals[2] points to c
|
||||
vals[0] points to a
|
||||
vals[1] points to b
|
||||
vals[2] points to c
|
||||
|
||||
c) The return value is the function must be a VALUE.
|
||||
|
||||
@@ -247,7 +247,7 @@ Step 5: Write your custom function
|
||||
|
||||
The VALUE is a union of major value types found inside calc.
|
||||
The v_type VALUE element determines which union element is
|
||||
being used. Assume that we have:
|
||||
being used. Assume that we have:
|
||||
|
||||
VALUE *vp;
|
||||
|
||||
@@ -427,12 +427,12 @@ Step 6: Register the function in the custom interface table
|
||||
level Makefile, one does not have unsatisfied symbols.
|
||||
|
||||
The brief description should be brief so that 'show custom' looks well
|
||||
formatted. If the brief description cannot fit on the same line as
|
||||
formatted. If the brief description cannot fit on the same line as
|
||||
the name without wrapping on a 80 col window, the description is
|
||||
probably too long and will not look nice in the show custom output.
|
||||
|
||||
The minargs places a lower bound on the number of args that
|
||||
must be supplied to the interface. This does NOT count
|
||||
must be supplied to the interface. This does NOT count
|
||||
the name argument given to custom(). So if minargs is 2:
|
||||
|
||||
custom("curds") /* call blocked at high level interface */
|
||||
|
@@ -22,7 +22,7 @@
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
# Comments, suggestions, bug fixes and questions about these routines
|
||||
# are welcome. Send EMail to the address given below.
|
||||
# are welcome. Send EMail to the address given below.
|
||||
#
|
||||
# Happy bit twiddling,
|
||||
#
|
||||
@@ -146,7 +146,7 @@ DEBUG= -O
|
||||
# BSD NO_SHARED=
|
||||
# SYSV NO_SHARED= -dn
|
||||
# IRIX NO_SHARED= -non_shared
|
||||
# disable NO_SHARED=
|
||||
# disable NO_SHARED=
|
||||
#
|
||||
# If in doubt, use NO_SHARED=
|
||||
#
|
||||
@@ -168,7 +168,7 @@ RANLIB=:
|
||||
# a default here just in case you want to build from this directory.
|
||||
#
|
||||
# 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
|
||||
# MAKE_FILE is empty, they they wont.
|
||||
#
|
||||
@@ -192,7 +192,7 @@ MAKE_FILE= Makefile
|
||||
#
|
||||
# By default, custom builtin functions may only be executed if calc
|
||||
# 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
|
||||
#
|
||||
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
|
||||
@@ -333,14 +333,14 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
|
||||
|
||||
##
|
||||
#
|
||||
# File list generation. You can ignore this section.
|
||||
# File list generation. You can ignore this section.
|
||||
#
|
||||
#
|
||||
# We will form the names of source files as if they were in a
|
||||
# sub-directory called calc/lib.
|
||||
#
|
||||
# NOTE: Due to bogus shells found on one common system we must have
|
||||
# an non-emoty else clause for every if condition. *sigh*
|
||||
# an non-emoty else clause for every if condition. *sigh*
|
||||
#
|
||||
##
|
||||
|
||||
@@ -376,7 +376,7 @@ depend:
|
||||
${Q}mkdir skel
|
||||
${Q}mkdir skel/custom
|
||||
-${Q}for i in ${C_SRC}; do \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
"$$i" > "skel/custom/$$i"; \
|
||||
done
|
||||
-${Q}for i in /dev/null ${H_SRC}; do \
|
||||
|
10
custom/argv
10
custom/argv
@@ -23,11 +23,11 @@ DESCRIPTION
|
||||
EXAMPLE
|
||||
> foo=5^713; bar=17; baz=list(2,3,4);
|
||||
> custom("argv", foo, bar, baz, 3+4.5i, pi())
|
||||
arg[0] rational_value size=1 sizeof=272
|
||||
arg[1] rational_value size=1 sizeof=68
|
||||
arg[2] list size=3 sizeof=256
|
||||
arg[3] complex_value size=1 sizeof=140
|
||||
arg[4] rational_value size=1 sizeof=84
|
||||
arg[0] rational_value size=1 sizeof=272
|
||||
arg[1] rational_value size=1 sizeof=68
|
||||
arg[2] list size=3 sizeof=256
|
||||
arg[3] complex_value size=1 sizeof=140
|
||||
arg[4] rational_value size=1 sizeof=84
|
||||
5
|
||||
|
||||
LIMITS
|
||||
|
@@ -11,12 +11,12 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Comments, suggestions, bug fixes and questions about these routines
|
||||
* are welcome. Send EMail to the address given below.
|
||||
* are welcome. Send EMail to the address given below.
|
||||
*
|
||||
* Happy bit twiddling,
|
||||
*
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
*
|
||||
* chongo <was here> /\../\
|
||||
*/
|
||||
@@ -98,13 +98,13 @@ c_argv(char *name, int count, VALUE **vals)
|
||||
case V_FILE: /* opened file id */
|
||||
type = "file";
|
||||
break;
|
||||
case V_RAND: /* address of additive 55 random state */
|
||||
case V_RAND: /* address of additive 55 random state */
|
||||
type = "rand_state";
|
||||
break;
|
||||
case V_RANDOM: /* address of Blum random state */
|
||||
case V_RANDOM: /* address of Blum random state */
|
||||
type = "random_state";
|
||||
break;
|
||||
case V_CONFIG: /* configuration state */
|
||||
case V_CONFIG: /* configuration state */
|
||||
type = "config_state";
|
||||
break;
|
||||
case V_HASH: /* hash state */
|
||||
@@ -115,7 +115,7 @@ c_argv(char *name, int count, VALUE **vals)
|
||||
break;
|
||||
#if 0
|
||||
/* XXX - V_OCTET is subject to change */
|
||||
case V_OCTET: /* octet (unsigned char) */
|
||||
case V_OCTET: /* octet (unsigned char) */
|
||||
type = "octet";
|
||||
break;
|
||||
#endif
|
||||
|
@@ -11,12 +11,12 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Comments, suggestions, bug fixes and questions about these routines
|
||||
* are welcome. Send EMail to the address given below.
|
||||
* are welcome. Send EMail to the address given below.
|
||||
*
|
||||
* Happy bit twiddling,
|
||||
*
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
*
|
||||
* chongo <was here> /\../\
|
||||
*/
|
||||
|
@@ -11,12 +11,12 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Comments, suggestions, bug fixes and questions about these routines
|
||||
* are welcome. Send EMail to the address given below.
|
||||
* are welcome. Send EMail to the address given below.
|
||||
*
|
||||
* Happy bit twiddling,
|
||||
*
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
*
|
||||
* chongo <was here> /\../\
|
||||
*/
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* Permission to use, copy, modify, and distribute this software and
|
||||
* its documentation for any purpose and without fee is hereby granted.
|
||||
*
|
||||
* Ernest Bowen, following Landon Curt Noll
|
||||
* Ernest Bowen, following Landon Curt Noll
|
||||
*/
|
||||
|
||||
#if defined(CUSTOM)
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* given:
|
||||
* count = 1;
|
||||
* vals[0] real number;
|
||||
* vals[0] real number;
|
||||
*
|
||||
* returns:
|
||||
* null
|
||||
@@ -29,7 +29,7 @@
|
||||
VALUE
|
||||
c_pzasusb8(char *name, int count, VALUE **vals)
|
||||
{
|
||||
VALUE result; /* what we will return */
|
||||
VALUE result; /* what we will return */
|
||||
ZVALUE z; /* numerator of the value */
|
||||
long half_cnt; /* number of HALFs in the numerator */
|
||||
USB8 *h; /* octet pointer */
|
||||
|
@@ -11,12 +11,12 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Comments, suggestions, bug fixes and questions about these routines
|
||||
* are welcome. Send EMail to the address given below.
|
||||
* are welcome. Send EMail to the address given below.
|
||||
*
|
||||
* Happy bit twiddling,
|
||||
*
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
*
|
||||
* chongo <was here> /\../\
|
||||
*/
|
||||
|
@@ -20,12 +20,12 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Comments, suggestions, bug fixes and questions about these routines
|
||||
* are welcome. Send EMail to the address given below.
|
||||
* are welcome. Send EMail to the address given below.
|
||||
*
|
||||
* Happy bit twiddling,
|
||||
*
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
* Landon Curt Noll
|
||||
* http://reality.sgi.com/chongo/
|
||||
*
|
||||
* chongo <was here> /\../\
|
||||
*/
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
/*
|
||||
* NOTE: See the file CUSTOM for instructions on how to add
|
||||
* custom functions.
|
||||
* custom functions.
|
||||
*/
|
||||
|
||||
|
||||
|
@@ -10,7 +10,7 @@ TYPES
|
||||
return null
|
||||
|
||||
DESCRIPTION
|
||||
This custom function does nothing. It is intented for testing
|
||||
This custom function does nothing. It is intented for testing
|
||||
of the general custom interface.
|
||||
|
||||
EXAMPLE
|
||||
|
@@ -11,7 +11,7 @@ TYPES
|
||||
|
||||
DESCRIPTION
|
||||
This custom function prints out the numerator of a real value
|
||||
in octets. Each HALF value is printed in a separate line.
|
||||
in octets. Each HALF value is printed in a separate line.
|
||||
|
||||
NOTE: The output will vary depending on the size of a HALF
|
||||
and the byte order of the system. See:
|
||||
@@ -26,15 +26,15 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
> custom("pzasusb8", 0x01020304050607080910111213141516);
|
||||
0: 13141516
|
||||
1: 09101112
|
||||
2: 05060708
|
||||
3: 01020304
|
||||
0: 13141516
|
||||
1: 09101112
|
||||
2: 05060708
|
||||
3: 01020304
|
||||
|
||||
> custom("pzasusb8", 10^25)
|
||||
0: 4a000000
|
||||
1: 16140148
|
||||
2: 00084595
|
||||
0: 4a000000
|
||||
1: 16140148
|
||||
2: 00084595
|
||||
|
||||
> printf("%x\n", 10^25);
|
||||
0x84595161401484a000000
|
||||
|
Reference in New Issue
Block a user