mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Release calc version 2.12.0.8
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.34 $
|
||||
* @(#) $Id: regress.cal,v 29.34 2006/06/25 20:33:26 chongo Exp $
|
||||
* @(#) $Revision: 29.35 $
|
||||
* @(#) $Id: regress.cal,v 29.35 2006/08/20 16:16:11 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:50:36
|
||||
@@ -743,6 +743,7 @@ define test_functions()
|
||||
local pi;
|
||||
local h, n, r, m, v;
|
||||
local n2, m2, v2;
|
||||
local t;
|
||||
|
||||
print '700: Beginning test_functions';
|
||||
|
||||
@@ -3461,7 +3462,7 @@ print '070: parsed test_redc()';
|
||||
*/
|
||||
define test_fileops()
|
||||
{
|
||||
local a, b, c, f, m, n, p, r, x, y, z;
|
||||
local a, b, c, f, m, n, p, r, s, x, y, z;
|
||||
local L = "Landon";
|
||||
local C = "Curt";
|
||||
local N = "Noll";
|
||||
@@ -3586,15 +3587,38 @@ define test_fileops()
|
||||
++ecnt;
|
||||
print '4267: ++ecnt;';
|
||||
vrfy(isfile(p=fopen(long,"r")) == 0,
|
||||
'4268: isfile(p=fopen(long,"r")) == 0');
|
||||
'4268: isfile(p=fopen(long,"r")) == 0');
|
||||
|
||||
/*
|
||||
* test fgetfile() and fgetline()
|
||||
*/
|
||||
vrfy(!iserror(p=fopen("tmp4200","w")),
|
||||
'4269: !iserror(p=fopen("tmp4200","w"))');
|
||||
vrfy(!iserror(fputs(p,"chongo\n")),
|
||||
'4270: !iserror(fputs(p,"chongo\n"))');
|
||||
vrfy(!iserror(fputs(p,"w\0a\0s\n")),
|
||||
'4271: !iserror(fputs(p,"w\0a\0s\n"))');
|
||||
vrfy(!iserror(fputs(p,"here\n")),
|
||||
'4272: !iserror(fputs(p,"here\n"))');
|
||||
vrfy(!iserror(fclose(p)), '4273: !iserror(fclose(p))');
|
||||
vrfy(!iserror(p=fopen("tmp4200","r")),
|
||||
'4274: !iserror(p=fopen("tmp4200","r"))');
|
||||
vrfy(!iserror(s=fgetline(p)), '4275: !iserror(s=fgetline(p))');
|
||||
vrfy(strcmp(s,"chongo") == 0, '4276: strcmp(s,"chongo") == 0');
|
||||
vrfy(!iserror(s=fgetfile(p)), '4277: !iserror(s=fgetfile(p))');
|
||||
vrfy(strcmp(s,"w\0a\0s\nhere\n") == 0,
|
||||
'4278: strcmp(s,"w\0a\0s\nhere\n") == 0');
|
||||
vrfy(!iserror(fclose(p)), '4279: !iserror(fclose(p))');
|
||||
|
||||
/*
|
||||
* cleanup
|
||||
*/
|
||||
x = rm("junk4200");
|
||||
print '4269: x = rm("junk4200")';
|
||||
print '4280: x = rm("junk4200")';
|
||||
x = rm("tmp4200");
|
||||
print '4281: x = rm("tmp4200")';
|
||||
|
||||
print '4270: Ending test_fileops';
|
||||
print '4282: Ending test_fileops';
|
||||
}
|
||||
print '071: parsed test_fileops()';
|
||||
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.1 $
|
||||
* @(#) $Id: set8700.cal,v 29.1 2006/05/20 19:35:33 chongo Exp $
|
||||
* @(#) $Revision: 29.2 $
|
||||
* @(#) $Id: set8700.cal,v 29.2 2006/08/20 16:16:11 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/set8700.cal,v $
|
||||
*
|
||||
* Under source code control: 2006/05/20 14:10:11
|
||||
@@ -70,3 +70,8 @@ define set8700_g(set8700_x)
|
||||
obj set8700_point {
|
||||
set8700_x, set8700_y, set8700_z
|
||||
}
|
||||
|
||||
global mat set8700_c[] = { 1, 2+3i, -5+4i, 5i+6, -7i };
|
||||
|
||||
global mat set8700_e[] = { 0, 1, 0, 0, 2, -3/2, 2, -1/2,
|
||||
-3, 0.5, -1.0, 0.5, 1.0, 0.0, 0.0, 0.0 };
|
||||
|
@@ -17,8 +17,8 @@
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: set8700.line,v 29.2 2006/06/20 09:29:16 chongo Exp $
|
||||
## @(#) $Revision: 29.4 $
|
||||
## @(#) $Id: set8700.line,v 29.4 2006/08/20 16:16:11 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/set8700.line,v $
|
||||
##
|
||||
## Under source code control: 2006/05/20 14:10:11
|
||||
@@ -402,3 +402,28 @@ set8700_P == (obj set8700_point = {1,2,3})
|
||||
set8700_L = list(mat[1] = {set8700_P}), protect(set8700_L[0][0]) == 16
|
||||
set8700_L = {{{4,5,6}}}, set8700_L[0][0] == set8700_P
|
||||
protect(set8700_L,0,2), set8700_L = {{{4,5,6}}}, set8700_L[0][0] == (obj set8700_point = {4,5,6})
|
||||
|
||||
## Testing quomod
|
||||
quomod(14,5,3,4) == error(10374)
|
||||
global set8700_a,set8700_b; quomod("abc", 4, set8700_a, set8700_b) == error(10375)
|
||||
quomod(14,5,set8700_a,set8700_b,0) == 1 && set8700_a == 2 && set8700_b == 4
|
||||
quomod(14,5,set8700_a,set8700_b,1) == 1 && set8700_a == 3 && set8700_b == -1
|
||||
quomod("abc",2,set8700_a,set8700_b) == error(10375)
|
||||
set8700_a = "abc"; quomod(14,5,set8700_a,set8700_b) == error(10375)
|
||||
set8700_a = null(); quomod(14,5,set8700_a,set8700_b,24) == 1; set8700_a == 3 && set8700_b == -1
|
||||
quomod(14,5,set8700_a,set8700_a) == error(10374)
|
||||
quomod(14,5,set8700_a,set8700_b,-1) == error(10375)
|
||||
protect(set8700_a,1); quomod(17,2,set8700_a,set8700_b) == error(10376)
|
||||
protect(set8700_a,0); quomod(17,2,set8700_a,set8700_b); set8700_a == 8 && set8700_b == 1
|
||||
set8700_p = &set8700_a, set8700_q = &set8700_b; quomod(14,5,*set8700_p,*set8700_q); *set8700_p == 2 && *set8700_q == 4
|
||||
|
||||
## Testing estr
|
||||
base(1/3) == 10
|
||||
strcmp(estr(null()), "\"\"") == 0
|
||||
strcmp(estr(bernoulli(48)), "-5609403368997817686249127547/46410") == 0
|
||||
strcmp(estr(sin(3i)), "1001787492740990189897i/100000000000000000000") == 0
|
||||
base(10) == 1/3
|
||||
strcmp(estr("fizzbin"), "\"fizzbin\"") == 0
|
||||
strcmp(estr(set8700_c), "mat[5]={1,2+3i,-5+4i,6+5i,-7i}") == 0
|
||||
strcmp(estr(set8700_e), "mat[16]={0,1,0,0,2,-3/2,2,-1/2,-3,1/2,-1,1/2,1,0,0,0}") == 0
|
||||
strcmp(estr(list(2,3,5)), "list(2,3,5)") == 0
|
||||
|
Reference in New Issue
Block a user