mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Release calc version 2.11.0t6
This commit is contained in:
50
lib/README
50
lib/README
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 1997 David I. Bell and Landon Curt Noll
|
||||
# Copyright (c) 1999 David I. Bell and Landon Curt Noll
|
||||
# Permission is granted to use, distribute, or modify this source,
|
||||
# provided that this copyright notice remains intact.
|
||||
|
||||
@@ -8,13 +8,12 @@ them to be useful!
|
||||
|
||||
If you write something that you think is useful, please send it to:
|
||||
|
||||
dbell@auug.org.au
|
||||
chongo@toad.com {uunet,pyramid,sun}!hoptoad!chongo
|
||||
calc-tester@postofc.corp.sgi.com
|
||||
|
||||
By convention, a lib file only defines and/or initializes functions,
|
||||
objects and variables. (The regression test is an exception.) Also by
|
||||
convention, the a usage message regarding each important object and
|
||||
function is printed at the time of the read.
|
||||
objects and variables. (The regress.cal and testxxx.cal regression test
|
||||
suite is an exception.) Also by convention, an additional usage message
|
||||
regarding important object and functions is printed.
|
||||
|
||||
If a lib file needs to load another lib file, it should use the -once
|
||||
version of read:
|
||||
@@ -45,16 +44,23 @@ global variable. By convention, "lib_debug" has the following meanings:
|
||||
printed at the time of the read in addition
|
||||
to other debug messages
|
||||
|
||||
To conform to the above convention, your lib files should end with
|
||||
lines of the form:
|
||||
When config("lib_debug") >= 0, function names and their arg are
|
||||
printed as they are defined. Sometimes this printing is not enough
|
||||
information. For example:
|
||||
|
||||
* useful obj definitions
|
||||
* functions with optional args
|
||||
* functions with optional args where the param() interface is used
|
||||
|
||||
For these cases we suggest that you place at the bottom of your code
|
||||
something like:
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj xyz defined";
|
||||
print "funcA(side_a, side_b, side_c) defined";
|
||||
print "funcB(size, mass) defined";
|
||||
print "funcA([val1 [, val2]]) defined";
|
||||
print "funcB(size, mass, ...) defined";
|
||||
}
|
||||
|
||||
|
||||
=-=
|
||||
|
||||
beer.cal
|
||||
@@ -100,7 +106,7 @@ deg.cal
|
||||
|
||||
ellip.cal
|
||||
|
||||
factor(iN, ia, B, force)
|
||||
efactor(iN, ia, B, force)
|
||||
|
||||
Attempt to factor using the elliptic functions: y^2 = x^3 + a*x + b.
|
||||
|
||||
@@ -160,7 +166,7 @@ mfactor.cal
|
||||
|
||||
mod.cal
|
||||
|
||||
mod(a)
|
||||
lmod(a)
|
||||
mod_print(a)
|
||||
mod_one()
|
||||
mod_cmp(a, b)
|
||||
@@ -250,7 +256,7 @@ pix.cal
|
||||
|
||||
pollard.cal
|
||||
|
||||
factor(N, N, ai, af)
|
||||
pfactor(N, N, ai, af)
|
||||
|
||||
Factor using Pollard's p-1 method.
|
||||
|
||||
@@ -520,6 +526,20 @@ test3400.cal
|
||||
This script is used by regress.cal to test trig functions.
|
||||
containing objects.
|
||||
|
||||
test3500.cal
|
||||
|
||||
global defaultverbose
|
||||
global err
|
||||
testfrem(x, y, verbose)
|
||||
testgcdrem(x, y, verbose)
|
||||
testf(str, n, verbose)
|
||||
testg(str, n, verbose)
|
||||
testh(str, n, N, verbose)
|
||||
test3500(verbose, n, N)
|
||||
|
||||
This script is used by regress.cal to test the functions frem,
|
||||
fcnt, gcdrem.
|
||||
|
||||
test4000.cal
|
||||
|
||||
global defaultverbose
|
||||
@@ -617,7 +637,7 @@ varargs.cal
|
||||
|
||||
xx_print.cal
|
||||
|
||||
isoctet(a) defined
|
||||
is_octet(a) defined
|
||||
list_print(a) defined
|
||||
mat_print (a) defined
|
||||
octet_print(a) defined
|
||||
|
@@ -20,7 +20,3 @@ for (i=99; i > 0;) {
|
||||
bottles = (i!=1) ? "bottles" : "bottle";
|
||||
print less, bottles, "of beer on the wall!\n";
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
/* nothing to do! */
|
||||
}
|
||||
|
@@ -60,7 +60,3 @@ define B(n)
|
||||
Bnmax = n;
|
||||
return Bn[n];
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "B(n) defined";
|
||||
}
|
||||
|
@@ -25,7 +25,3 @@ define bigprime(a, m, p)
|
||||
print " " : n;
|
||||
}
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "bigprime(a, m, p) defined";
|
||||
}
|
||||
|
@@ -113,11 +113,4 @@ define fixdms(a)
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj dms {deg, min, sec} defined";
|
||||
print "dms(deg, min, sec) defined";
|
||||
print "dms_add(a, b) defined";
|
||||
print "dms_neg(a) defined";
|
||||
print "dms_sub(a, b) defined";
|
||||
print "dms_mul(a, b) defined";
|
||||
print "dms_print(a) defined";
|
||||
print "dms_abs(a) defined";
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* only an approximation, read "A Course in Number Theory and Cryptography"
|
||||
* by Neal Koblitz for a good explanation.
|
||||
*
|
||||
* factor(iN, ia, B, force)
|
||||
* efactor(iN, ia, B, force)
|
||||
* iN is the number to be factored.
|
||||
* ia is the initial value of a in the equation, and each successive
|
||||
* value of a is an independent attempt at factoring (default 1).
|
||||
@@ -66,7 +66,7 @@ global b; /* second coefficient */
|
||||
global f; /* found factor */
|
||||
|
||||
|
||||
define factor(iN, ia, B, force)
|
||||
define efactor(iN, ia, B, force)
|
||||
{
|
||||
local C, x, p;
|
||||
|
||||
@@ -165,7 +165,3 @@ define point_pow(p, pow)
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "factor(N, I, B, force) defined";
|
||||
}
|
||||
|
@@ -6,7 +6,3 @@
|
||||
*/
|
||||
|
||||
while(1) print "Hello World!";
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
/* nothing to do */
|
||||
}
|
||||
|
@@ -1029,7 +1029,3 @@ ldebug(funct, str)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "lucas(h, n) defined";
|
||||
}
|
||||
|
@@ -374,7 +374,3 @@ lucas_chk(high_n, quiet)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "lucas_chk(high_n) defined";
|
||||
}
|
||||
|
@@ -31,7 +31,3 @@ define mersenne(p)
|
||||
/* 2^p-1 is prime iff u(p) = 0 mod 2^p-1 */
|
||||
return (u == 0);
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "mersenne(p) defined";
|
||||
}
|
||||
|
28
lib/mod.cal
28
lib/mod.cal
@@ -12,12 +12,12 @@ obj mod {a}; /* definition of the object */
|
||||
global mod_value = 100; /* modulus value (value of N) */
|
||||
|
||||
|
||||
define mod(a)
|
||||
define lmod(a)
|
||||
{
|
||||
local obj mod x;
|
||||
|
||||
if (!isreal(a) || !isint(a))
|
||||
quit "Bad argument for mod function";
|
||||
quit "Bad argument for lmod function";
|
||||
x.a = a % mod_value;
|
||||
return x;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ define mod_print(a)
|
||||
|
||||
define mod_one()
|
||||
{
|
||||
return mod(1);
|
||||
return lmod(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,9 +51,9 @@ define mod_cmp(a, b)
|
||||
define mod_rel(a, b)
|
||||
{
|
||||
if (isnum(a))
|
||||
a = mod(a);
|
||||
a = lmod(a);
|
||||
if (isnum(b))
|
||||
b = mod(b);
|
||||
b = lmod(b);
|
||||
if (a.a < b.a)
|
||||
return -1;
|
||||
return a.a != b.a;
|
||||
@@ -163,9 +163,9 @@ define mod_div(a, b)
|
||||
|
||||
obj mod x, y;
|
||||
if (isnum(a))
|
||||
a = mod(a);
|
||||
a = lmod(a);
|
||||
if (isnum(b))
|
||||
b = mod(b);
|
||||
b = lmod(b);
|
||||
c = gcd(a.a, b.a);
|
||||
x.a = a.a / c;
|
||||
y.a = b.a / c;
|
||||
@@ -191,20 +191,6 @@ define mod_pow(a, b)
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj mod {a} defined";
|
||||
print "mod(a) defined";
|
||||
print "mod_print(a) defined";
|
||||
print "mod_one(a) defined";
|
||||
print "mod_cmp(a, b) defined";
|
||||
print "mod_rel(a, b) defined";
|
||||
print "mod_add(a, b) defined";
|
||||
print "mod_sub(a, b) defined";
|
||||
print "mod_mod(a, b) defined";
|
||||
print "mod_square(a) defined";
|
||||
print "mod_inc(a) defined";
|
||||
print "mod_dec(a) defined";
|
||||
print "mod_inv(a) defined";
|
||||
print "mod_div(a, b) defined";
|
||||
print "mod_pow(a, b) defined";
|
||||
print "mod_value defined";
|
||||
print "set mod_value as needed";
|
||||
}
|
||||
|
@@ -592,41 +592,3 @@ define set_print(a)
|
||||
}
|
||||
|
||||
local N, M; /* End scope of static variables N, M */
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "isset(a) defined";
|
||||
print "setbound(n) defined";
|
||||
print "empty() defined";
|
||||
print "full() defined";
|
||||
print "isin(a, b) defined";
|
||||
print "addmember(a, n) defined";
|
||||
print "rmmember(a, n) defined";
|
||||
print "set() defined";
|
||||
print "mkset(s) defined";
|
||||
print "primes(a, b) defined";
|
||||
print "set_max(a) defined";
|
||||
print "set_min(a) defined";
|
||||
print "set_not(a) defined";
|
||||
print "set_cmp(a, b) defined";
|
||||
print "set_rel(a, b) defined";
|
||||
print "set_or(a, b) defined";
|
||||
print "set_and(a, b) defined";
|
||||
print "set_comp(a) defined";
|
||||
print "set_setminus(a, b) defined";
|
||||
print "set_xor(a,b) defined";
|
||||
print "set_content(a) defined";
|
||||
print "set_add(a, b) defined";
|
||||
print "set_sub(a, b) defined";
|
||||
print "set_mul(a, b) defined";
|
||||
print "set_square(a) defined";
|
||||
print "set_pow(a, n) defined";
|
||||
print "set_sum(a) defined";
|
||||
print "set_plus(a) defined";
|
||||
print "interval(a, b) defined";
|
||||
print "isinterval(a) defined";
|
||||
print "set_mod(a, b) defined";
|
||||
print "randset(n, a, b) defined";
|
||||
print "polyvals(L, A) defined";
|
||||
print "polyvals2(L, A, B) defined";
|
||||
print "set_print(a) defined";
|
||||
}
|
||||
|
@@ -66,8 +66,3 @@ define pellx(D)
|
||||
}
|
||||
return Q1;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "pell(D) defined";
|
||||
print "pellx(D) defined";
|
||||
}
|
||||
|
@@ -47,7 +47,3 @@ define qpi(epsilon)
|
||||
}
|
||||
return (bround(1/an, bits));
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "qpi(epsilon) defined";
|
||||
}
|
||||
|
@@ -38,7 +38,3 @@ define pi_of_x(x)
|
||||
}
|
||||
return primes;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "pi_of_x(x) defined";
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* Factor using Pollard's p-1 method.
|
||||
*/
|
||||
|
||||
define factor(N, B, ai, af)
|
||||
define pfactor(N, B, ai, af)
|
||||
{
|
||||
local a, k, i, d;
|
||||
|
||||
@@ -28,7 +28,3 @@ define factor(N, B, ai, af)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "factor(N, B, ai, af) defined";
|
||||
}
|
||||
|
35
lib/poly.cal
35
lib/poly.cal
@@ -689,39 +689,4 @@ c=pol(1+2i,3+4i,5+6i);
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj poly {p} defined";
|
||||
print "pol() defined";
|
||||
print "poly_print(a) defined";
|
||||
print "poly_add(a, b) defined";
|
||||
print "poly_sub(a, b) defined";
|
||||
print "poly_mul(a, b) defined";
|
||||
print "poly_div(a, b) defined";
|
||||
print "poly_quo(a,b) defined";
|
||||
print "poly_mod(a,b) defined";
|
||||
print "poly_neg(a) defined";
|
||||
print "poly_conj(a) defined";
|
||||
print "poly_cmp(a,b) defined";
|
||||
print "iszero(a) defined";
|
||||
print "plist(a) defined";
|
||||
print "listmul(a,b) defined";
|
||||
print "ev(a,t) defined";
|
||||
print "evp(s,t) defined";
|
||||
print "ispoly(a) defined";
|
||||
print "isstring(a) defined";
|
||||
print "var(name) defined";
|
||||
print "pcoeff(a) defined";
|
||||
print "pterm(a,n) defined";
|
||||
print "deg(a) defined";
|
||||
print "polydiv(a,b) defined";
|
||||
print "D(a,n) defined";
|
||||
print "Dp(a,n) defined";
|
||||
print "pgcd(a,b) defined";
|
||||
print "plcm(a,b) defined";
|
||||
print "monic(a) defined";
|
||||
print "pfgcd(a,b) defined";
|
||||
print "interp(X,Y,x) defined";
|
||||
print "makediffs(X,Y) defined";
|
||||
print "evalfd(T,x) defined";
|
||||
print "mdet(A) defined";
|
||||
print "M(A,n,I,J) defined";
|
||||
print "mprint(A) defined";
|
||||
}
|
||||
|
@@ -94,8 +94,3 @@ define showvalues(str) {
|
||||
print "\t":eval(str);
|
||||
}
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "adder() defined";
|
||||
print "showvalues(str) defined";
|
||||
}
|
||||
|
@@ -48,8 +48,3 @@ define psqrt(u, p)
|
||||
}
|
||||
return min(v, p - v);
|
||||
}
|
||||
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "psqrt(u, p) defined";
|
||||
}
|
||||
|
15
lib/quat.cal
15
lib/quat.cal
@@ -197,19 +197,4 @@ define quat_shift(a, b)
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj quat {s, v} defined";
|
||||
print "quat(a, b, c, d) defined";
|
||||
print "quat_print(a) defined";
|
||||
print "quat_norm(a) defined";
|
||||
print "quat_abs(a, e) defined";
|
||||
print "quat_conj(a) defined";
|
||||
print "quat_add(a, e) defined";
|
||||
print "quat_sub(a, e) defined";
|
||||
print "quat_inc(a) defined";
|
||||
print "quat_dec(a) defined";
|
||||
print "quat_neg(a) defined";
|
||||
print "quat_mul(a, b) defined";
|
||||
print "quat_div(a, b) defined";
|
||||
print "quat_inv(a) defined";
|
||||
print "quat_scale(a, b) defined";
|
||||
print "quat_shift(a, b) defined";
|
||||
}
|
||||
|
@@ -112,7 +112,3 @@ define randbitrun(run_cnt)
|
||||
printf("length>%d\t\t\t\t\tcount=%d\n", MAX_RUN, long_run_cnt);
|
||||
printf("max length=%d\n", max_run);
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "randbitrun([run_length]) defined";
|
||||
}
|
||||
|
@@ -129,7 +129,3 @@ randmprime(bits, seed, dbg)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "randmprime(bits, seed [,dbg]) defined";
|
||||
}
|
||||
|
@@ -112,7 +112,3 @@ define randombitrun(run_cnt)
|
||||
printf("length>%d\t\t\t\t\tcount=%d\n", MAX_RUN, long_run_cnt);
|
||||
printf("max length=%d\n", max_run);
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "randombitrun([run_length]) defined";
|
||||
}
|
||||
|
@@ -121,7 +121,3 @@ define randomrun(run_cnt)
|
||||
printf("length>%d\t\t\t\t\tcount=%d\n", MAX_RUN, long_run_cnt);
|
||||
printf("max length=%d\n", max_run);
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "randomrun([run_length]) defined";
|
||||
}
|
||||
|
@@ -7010,7 +7010,7 @@ define test_bigcomb()
|
||||
{
|
||||
local a, b, n, i, v1, v2;
|
||||
|
||||
print '7900: Starting test_bigcomb()';
|
||||
print '7900: Starting test_bigcomb';
|
||||
a = 1234/4321;
|
||||
print '7901: a = 1234/4321';
|
||||
b = 3456/6543;
|
||||
@@ -7033,7 +7033,7 @@ define test_bigcomb()
|
||||
vrfy(f7900(-7/4,33/4,-2) == g7900(-7/4,33/4,-2),
|
||||
'7913: f7900(-7/4,33/4,-2) == g7900(-7/4,33/4,-2)');
|
||||
|
||||
print '7914: Ending test_bigcomb()';
|
||||
print '7914: Ending test_bigcomb';
|
||||
}
|
||||
print '186: parsed test_bigcomb()';
|
||||
|
||||
@@ -7048,7 +7048,7 @@ define test_natnumset()
|
||||
{
|
||||
local A, B, C, D, P, P1, L1, L2;
|
||||
|
||||
print '8000: Starting test_natnumset()';
|
||||
print '8000: Starting test_natnumset';
|
||||
|
||||
A = set(17, 2, 0, 24, 2);
|
||||
print '8101: A = set(17, 2, 0, 24, 2);';
|
||||
@@ -7105,7 +7105,7 @@ define test_natnumset()
|
||||
vrfy(polyvals2(L2,C,D) == set(12,16,21,27,45,55,77,91),
|
||||
'8135: polyvals(L2,C,D) == set(12,16,21,27,45,55,77,91)');
|
||||
|
||||
print '8136: Ending test_natnumset()';
|
||||
print '8136: Ending test_natnumset';
|
||||
}
|
||||
print '188: parsed test_natnumset()';
|
||||
|
||||
@@ -7115,7 +7115,7 @@ print '188: parsed test_natnumset()';
|
||||
*/
|
||||
define test_somenew()
|
||||
{
|
||||
print '8200: Starting test_somenew()';
|
||||
print '8200: Starting test_somenew';
|
||||
|
||||
vrfy(char(-1) == char(255), '8201: char(-1) == char(255)');
|
||||
vrfy(char(258) == char(2), '8202: char(258) == char(2)');
|
||||
@@ -7139,7 +7139,7 @@ define test_somenew()
|
||||
vrfy(1/(1/0) == 0, '8215: 1/(1/0) == 0');
|
||||
vrfy(inverse(1/0) == 0, '8216: inverse(1/0) == 0');
|
||||
|
||||
print '8217: Ending test_somenew()';
|
||||
print '8217: Ending test_somenew';
|
||||
}
|
||||
print '189: parsed test_somenew()';
|
||||
|
||||
@@ -7392,6 +7392,85 @@ return test_natnumset();
|
||||
print;
|
||||
return test_somenew();
|
||||
|
||||
|
||||
/*
|
||||
* read various calc libs
|
||||
*
|
||||
* We read most of the calc libs shipped with the distribution.
|
||||
* There are a few lib files that are not read:
|
||||
*
|
||||
* beer.cal - prints a bunch of things when loaded
|
||||
* hello.cal - designed to go into an infinite loop
|
||||
* lucal.cal - already read by this file
|
||||
* lucas_chk.cal - already read by this file
|
||||
* lucas_tbl.cal - duplicatres code already read by another file
|
||||
* regress.cal - this file
|
||||
* surd.cal - already read by this file
|
||||
* testXXXX.cal - already read by this file
|
||||
* xx_print.cal - prints a bunch of things when loaded
|
||||
*
|
||||
* We want to do this 2nd to last; ahead of any final cleanup and behind
|
||||
* all of real actions of regress.cal.
|
||||
*/
|
||||
print;
|
||||
print '9800: Starting read of selected calc libs';
|
||||
read -once bernoulli;
|
||||
print '9801: read -once bernoulli';
|
||||
read -once bigprime;
|
||||
print '9802: read -once bigprime';
|
||||
read -once chrem;
|
||||
print '9803: read -once chrem';
|
||||
read -once deg;
|
||||
print '9804: read -once deg';
|
||||
read -once ellip;
|
||||
print '9805: read -once ellip';
|
||||
read -once mersenne;
|
||||
print '9806: read -once mersenne';
|
||||
read -once mfactor;
|
||||
print '9807: read -once mfactor';
|
||||
read -once mod;
|
||||
print '9808: read -once mod';
|
||||
read -once natnumset;
|
||||
print '9809: read -once natnumset';
|
||||
read -once pell;
|
||||
print '9810: read -once pell';
|
||||
read -once pi;
|
||||
print '9811: read -once pi';
|
||||
read -once pix;
|
||||
print '9812: read -once pix';
|
||||
read -once pollard;
|
||||
print '9813: read -once pollard';
|
||||
read -once poly;
|
||||
print '9814: read -once poly';
|
||||
read -once prompt;
|
||||
print '9815: read -once prompt';
|
||||
read -once psqrt;
|
||||
print '9816: read -once psqrt';
|
||||
read -once quat;
|
||||
print '9817: read -once quat';
|
||||
read -once randbitrun;
|
||||
print '9818: read -once randbitrun';
|
||||
read -once randmprime;
|
||||
print '9819: read -once randmprime';
|
||||
read -once randombitrun;
|
||||
print '9820: read -once randombitrun';
|
||||
read -once randomrun;
|
||||
print '9821: read -once randomrun';
|
||||
read -once randrun;
|
||||
print '9822: read -once randrun';
|
||||
read -once seedrandom;
|
||||
print '9823: read -once seedrandom';
|
||||
read -once solve;
|
||||
print '9824: read -once solve';
|
||||
read -once sumsq;
|
||||
print '9825: read -once sumsq';
|
||||
read -once unitfrac;
|
||||
print '9826: read -once unitfrac';
|
||||
read -once varargs;
|
||||
print '9827: read -once varargs';
|
||||
print '9828: Ending read of selected calc libs';
|
||||
|
||||
|
||||
/*
|
||||
* cleanup and report the results
|
||||
*/
|
||||
|
@@ -41,7 +41,3 @@ define solve(low, high, epsilon)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "solve(low, high, epsilon) defined";
|
||||
}
|
||||
|
@@ -37,7 +37,3 @@ define ss(p)
|
||||
}
|
||||
print a : "^2 +" , b : "^2 =" , a^2 + b^2;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "ss(p) defined";
|
||||
}
|
||||
|
19
lib/surd.cal
19
lib/surd.cal
@@ -263,25 +263,6 @@ define surd_rel(a, b)
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj surd {a, b} defined";
|
||||
print "surd(a, b) defined";
|
||||
print "surd_print(a) defined";
|
||||
print "surd_conj(a) defined";
|
||||
print "surd_norm(a) defined";
|
||||
print "surd_value(a, xepsilon) defined";
|
||||
print "surd_add(a, b) defined";
|
||||
print "surd_sub(a, b) defined";
|
||||
print "surd_inc(a) defined";
|
||||
print "surd_dec(a) defined";
|
||||
print "surd_neg(a) defined";
|
||||
print "surd_mul(a, b) defined";
|
||||
print "surd_square(a) defined";
|
||||
print "surd_scale(a, b) defined";
|
||||
print "surd_shift(a, b) defined";
|
||||
print "surd_div(a, b) defined";
|
||||
print "surd_inv(a) defined";
|
||||
print "surd_sgn(a) defined";
|
||||
print "surd_cmp(a, b) defined";
|
||||
print "surd_rel(a, b) defined";
|
||||
print "surd_type defined";
|
||||
print "set surd_type as needed";
|
||||
}
|
||||
|
@@ -10,7 +10,3 @@
|
||||
*/
|
||||
|
||||
++value;
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
/* nothing to do */
|
||||
}
|
||||
|
@@ -95,7 +95,3 @@ define ckmat()
|
||||
/* args match the matrix in the object */
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
/* nothing to do */
|
||||
}
|
||||
|
@@ -491,25 +491,3 @@ define test2600(verbose, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose defined";
|
||||
print "global err defined";
|
||||
print "testismult(str,n,verbose) defined";
|
||||
print "testsqrt(str,n,eps,verbose) defined";
|
||||
print "testexp(str,n,eps,verbose) defined";
|
||||
print "testln(str,n,eps,verbose) defined";
|
||||
print "testpower(str,n,b,eps,verbose) defined";
|
||||
print "testgcd(str,n,verbose) defined";
|
||||
print "cpow(x,n,eps) defined";
|
||||
print "cexp(x,eps) defined";
|
||||
print "cln(x,eps) defined";
|
||||
print "mkreal() defined";
|
||||
print "mkcomplex() defined";
|
||||
print "mkbigreal() defined";
|
||||
print "mksmallreal() defined";
|
||||
print "testappr(str,n,verbose) defined";
|
||||
print "checkappr(x,y,z,verbose) defined";
|
||||
print "checkresult(x,y,z,a) defined";
|
||||
print "test2600(verbose,tnum) defined";
|
||||
}
|
||||
|
@@ -308,23 +308,3 @@ define test2700(verbose, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose defined";
|
||||
print "global err defined";
|
||||
print "mknonnegreal() defined";
|
||||
print "mkposreal() defined";
|
||||
print "mkreal_2700() defined";
|
||||
print "mknonzeroreal() defined";
|
||||
print "mkposfrac() defined";
|
||||
print "mkfrac() defined";
|
||||
print "mksquarereal() defined";
|
||||
print "mknonsquarereal() defined";
|
||||
print "mkcomplex_2700() defined";
|
||||
print "testcsqrt(str,n,verbose) defined";
|
||||
print "checksqrt(x,y,z,v) defined";
|
||||
print "checkavrem(A,B,X,eps) defined";
|
||||
print "checkrounding(s,n,t,u,z) defined";
|
||||
print "iscomsq(x) defined";
|
||||
print "test2700(verbose,tnum) defined";
|
||||
}
|
||||
|
@@ -17,14 +17,3 @@ define res_mul(a,b) {local obj res v = {(a.r * b.r) % md}; return v;};
|
||||
define res_neg(a) {local obj res v = {(-a.r) % md}; return v;};
|
||||
define res_inv(a) {local obj res v = {minv(a.r, md)}; return v;};
|
||||
define res(x) {local obj res v = {x % md}; return v;};
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "obj res defined";
|
||||
print "global md defined";
|
||||
print "res_test(a) defined";
|
||||
print "res_sub(a, b) defined";
|
||||
print "res_mul(a, b) defined";
|
||||
print "res_neg(a) defined";
|
||||
print "res_inv(a) defined";
|
||||
print "res(x) defined";
|
||||
}
|
||||
|
@@ -122,11 +122,3 @@ define test3300(verbose, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose defined";
|
||||
print "global err defined";
|
||||
print "testi(str, n, N, verbose) defined";
|
||||
print "testr(str, n, N, verbose) defined";
|
||||
print "test3300(verbose, tnum) defined";
|
||||
}
|
||||
|
@@ -299,15 +299,3 @@ define test3400(verbose, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose defined";
|
||||
print "global err defined";
|
||||
print "test3401(str, n, eps, verbose) defined";
|
||||
print "test3402(str, n, eps, verbose) defined";
|
||||
print "test3403(str, n, eps, verbose) defined";
|
||||
print "test3404(str, n, eps, verbose) defined";
|
||||
print "test3405(str, n, eps, verbose) defined";
|
||||
print "test3406(str, n, eps, verbose) defined";
|
||||
print "test3400(verbose, tnum) defined";
|
||||
}
|
||||
|
@@ -272,14 +272,3 @@ define test3500(verbose, tnum, n, N)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose defined";
|
||||
print "global err defined";
|
||||
print "testfrem(x, y, verbose) defined";
|
||||
print "testgcdrem(x, y, verbose) defined";
|
||||
print "testf(str, n, verbose) defined";
|
||||
print "testg(str, n, verbose) defined";
|
||||
print "testh(str, n, N, verbose) defined";
|
||||
print "test3500(verbose, n, N) defined";
|
||||
}
|
||||
|
@@ -452,32 +452,3 @@ define test4000(v, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose";
|
||||
print "global err";
|
||||
print "global BASEB";
|
||||
print "global BASE";
|
||||
print "global COUNT";
|
||||
print "global SKIP";
|
||||
print "global RESIDUE";
|
||||
print "global MODULUS";
|
||||
print "global K1";
|
||||
print "global H1";
|
||||
print "global K2";
|
||||
print "global H2";
|
||||
print "global K3";
|
||||
print "global H3";
|
||||
print "plen(N) defined";
|
||||
print "clen(N) defined";
|
||||
print "ptimes(str, N, n, count, skip, verbose) defined";
|
||||
print "ctimes(str, N, n, count, skip, verbose) defined";
|
||||
print "crtimes(str, a, b, n, count, skip, verbose) defined";
|
||||
print "ntimes(str, N, n, count, skip, residue, mod, verbose) defined";
|
||||
print "testnextcand(str, N, n, cnt, skip, res, mod, verbose) defined";
|
||||
print "testnext1(x, y, count, skip, residue, modulus) defined";;
|
||||
print "testprevcand(str, N, n, cnt, skip, res, mod, verbose) defined";
|
||||
print "testprev1(x, y, count, skip, residue, modulus) defined";
|
||||
print "test4000(verbose, tnum) defined";
|
||||
}
|
||||
|
@@ -472,20 +472,3 @@ define test4100(v, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global defaultverbose";
|
||||
print "global err";
|
||||
print "global K1";
|
||||
print "global K2";
|
||||
print "global BASEB";
|
||||
print "global BASE";
|
||||
print "rlen_4100(N) defined";
|
||||
print "olen(N) defined";
|
||||
print "test4101(x, y, m, k, z1, z2) defined";
|
||||
print "testall(str, n, N, M, verbose) defined";
|
||||
print "times(str, N, n, verbose) defined";
|
||||
print "powtimes(str, N1, N2, n, verbose) defined";
|
||||
print "inittimes(str, N, n, verbose) defined";
|
||||
print "test4100(verbose, tnum) defined";
|
||||
}
|
||||
|
@@ -304,12 +304,3 @@ define test4600(v, tnum)
|
||||
}
|
||||
return tnum;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "stest(str [, verbose]) defined";
|
||||
print "ttest([m, [n [,verbose]]]) defined";
|
||||
print "sprint(x) defined";
|
||||
print "findline(f,s) defined";
|
||||
print "findlineold(f,s) defined";
|
||||
print "test4600(verbose, tnum) defined";
|
||||
}
|
||||
|
@@ -48,9 +48,3 @@ define test5100(x)
|
||||
}
|
||||
global a5100 = a5100, b5100 = b5100;
|
||||
}
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global a5100";
|
||||
print "global b5100";
|
||||
print "test5100(x) defined";
|
||||
}
|
||||
|
@@ -30,11 +30,3 @@ static a5200 = 20;
|
||||
define f5200(x) = a5200 + x;
|
||||
define g5200(x) {global a5200 = 30; return a5200 + x;}
|
||||
define h5200(x) = a5200 + x;
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "global a5200";
|
||||
print "static a5200";
|
||||
print "f5200(x) defined";
|
||||
print "g5200(x) defined";
|
||||
print "h5200(x) defined";
|
||||
}
|
||||
|
@@ -27,8 +27,3 @@ define unitfrac(x)
|
||||
} while ((num(x) > 1) || (x == di) || (x == 1));
|
||||
print ' [1/1]',, x;
|
||||
}
|
||||
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "unitfrac(x) defined";
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ print "global blkmax defined, assigned value 8";
|
||||
print;
|
||||
|
||||
B = blk();
|
||||
define isoctet(a) = istype(a, B[0]);
|
||||
define is_octet(a) = istype(a, B[0]);
|
||||
|
||||
define list_print(a) {
|
||||
local i;
|
||||
@@ -131,7 +131,7 @@ define strchar(a) {
|
||||
if (isstr(a))
|
||||
a = ord(a);
|
||||
|
||||
else if (isoctet(a))
|
||||
else if (is_octet(a))
|
||||
a = a; /* This converts octet to number */
|
||||
|
||||
else if (!isint(a) || a < 0 || a > 255)
|
||||
@@ -269,15 +269,3 @@ define octet_print(a) {
|
||||
print "Here is the earlier block with a new octet_print()";
|
||||
print B1;
|
||||
print;
|
||||
|
||||
if (config("lib_debug") >= 0) {
|
||||
print "isoctet(a) defined";
|
||||
print "list_print(a) defined";
|
||||
print "mat_print (a) defined";
|
||||
print "octet_print(a) defined";
|
||||
print "blk_print(a) defined";
|
||||
print "nblk_print (a) defined";
|
||||
print "strchar(a) defined";
|
||||
print "file_print(a) defined";
|
||||
print "error_print(a) defined";
|
||||
}
|
||||
|
Reference in New Issue
Block a user