## Diff of /incubator/ZabrodskyAAT/ZabrodskyAAT.cls[r6393] .. [r6394]  Maximize  Restore

### Switch to side-by-side view

```--- a/incubator/ZabrodskyAAT/ZabrodskyAAT.cls
+++ b/incubator/ZabrodskyAAT/ZabrodskyAAT.cls
@@ -59,10 +59,10 @@
use strict arg N, K
A = .array~new(K)
Z = .array~new(K)
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \K~datatype('W') then raise error 93.905 array(2, K) RETURN ('') -- must be a whole number
-if N < 0 then raise error 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
-if K > N then raise error 93.908 array(1, K, N) RETURN ('') --  must not exceed limit
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \K~datatype('W') then raise syntax 93.905 array(2, K) RETURN ('') -- must be a whole number
+if N < 0 then raise syntax 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
+if K > N then raise syntax 93.908 array(1, K, N) RETURN ('') --  must not exceed limit
do J = 1 to K
A[J] = J
end
@@ -89,8 +89,8 @@
::method permutation class
use strict arg N
Z = .array~new()
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if N < 2 then raise error 93.900 array('Argument 1 must be greater than 1.') RETURN (Z)
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if N < 2 then raise syntax 93.900 array('Argument 1 must be greater than 1.') RETURN (Z)
C. = 1
Pr. = 1
do J = 1 to N
@@ -132,10 +132,10 @@
/*----------------------------------------------------------------------------*/
::method fact class
use strict arg N, P = 9
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
-if N < 0 then raise error 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
-if P < 0 then raise error 93.906 array(2, P) RETURN ('') -- must be zero or a positive whole number
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
+if N < 0 then raise syntax 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
+if P < 0 then raise syntax 93.906 array(2, P) RETURN ('') -- must be zero or a positive whole number
numeric digits P
F = 1
do J = 2 to N
@@ -149,10 +149,10 @@
/*----------------------------------------------------------------------------*/
::method stirling class
use strict arg N, P, Q = 9
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
-if N <= 0 then raise error 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
-if P <= 0 then raise error 93.906 array(2, P) RETURN ('') -- must be zero or a positive whole number
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
+if N <= 0 then raise syntax 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
+if P <= 0 then raise syntax 93.906 array(2, P) RETURN ('') -- must be zero or a positive whole number
numeric digits Q
Pi = self~PI()
E = self~E()
@@ -165,8 +165,8 @@
/*----------------------------------------------------------------------------*/
::method fib class
use strict arg N, P = 9
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
if N = 0 | N = 1 then return N
numeric digits P
A = 0
@@ -182,9 +182,9 @@
/*----------------------------------------------------------------------------*/
::method general_fib class
use strict arg N, P, Q = 9
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
-if \Q~datatype('W') then raise error 93.905 array(3, Q) RETURN ('') -- must be a whole number
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \Q~datatype('W') then raise syntax 93.905 array(3, Q) RETURN ('') -- must be a whole number
if N = 1 then return 1
numeric digits Q
Sqrt5 = self~SQRT(5, P)
@@ -197,9 +197,9 @@
/*----------------------------------------------------------------------------*/
::method ncomb class
use strict arg N, K
-if \N~datatype('W') then raise error 93.905 array(1, N) RETURN ('') -- must be a whole number
-if \K~datatype('W') then raise error 93.905 array(2, K) RETURN ('') -- must be a whole number
-if N < 0 then raise error 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
+if \N~datatype('W') then raise syntax 93.905 array(1, N) RETURN ('') -- must be a whole number
+if \K~datatype('W') then raise syntax 93.905 array(2, K) RETURN ('') -- must be a whole number
+if N < 0 then raise syntax 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
if K < 0 | N < K then return 0
if K = N then return 1
if K > N - K then K = N - K
@@ -215,9 +215,9 @@
/*----------------------------------------------------------------------------*/
::method primes class
use strict arg K, Q = 9
-if \K~datatype('W') then raise error 93.905 array(1, K) RETURN ('') -- must be a whole number
-if \Q~datatype('W') then raise error 93.905 array(2, Q) RETURN ('') -- must be a whole number
-if K <= 0 then raise error 93.907 array(1, K) RETURN ('') -- must be a positive whole number
+if \K~datatype('W') then raise syntax 93.905 array(1, K) RETURN ('') -- must be a whole number
+if \Q~datatype('W') then raise syntax 93.905 array(2, Q) RETURN ('') -- must be a whole number
+if K <= 0 then raise syntax 93.907 array(1, K) RETURN ('') -- must be a positive whole number
P = .array~new()
numeric digits Q
P[1] = 2
@@ -263,9 +263,9 @@
/*----------------------------------------------------------------------------*/
::method d2r class
use strict arg Decimal
-if \Decimal~datatype('W') then raise error 93.905 array(1, Decimal) RETURN ('') -- must be a whole number
-if Decimal <= 0 then raise error 93.907 array(1, K) RETURN ('') -- must be a positive whole number
-if Decimal > 3999 then raise error 93.908 array(1, 3999, Decimal) RETURN ('')
+if \Decimal~datatype('W') then raise syntax 93.905 array(1, Decimal) RETURN ('') -- must be a whole number
+if Decimal <= 0 then raise syntax 93.907 array(1, K) RETURN ('') -- must be a positive whole number
+if Decimal > 3999 then raise syntax 93.908 array(1, 3999, Decimal) RETURN ('')
parse value RIGHT(FORMAT(Decimal, , 0), 4, 0),
with A +1 B +1 C +1 D
parse value "1 1 1 1 3 4 4 4 4 7",
@@ -284,13 +284,13 @@
/*----------------------------------------------------------------------------*/
::method heron class
use strict arg X, Y, Z, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \Y~datatype('N') then raise error 93.904 array(2, Y) RETURN ('') -- must be a number
-if \Z~datatype('N') then raise error 93.904 array(3, Z) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(4, P) RETURN ('') -- must be a whole number
-if X <= 0 then raise error 93.900 array('Argument 1 must be greater than zero.') RETURN ('')
-if Y <= 0 then raise error 93.900 array('Argument 2 must be greater than zero.') RETURN ('')
-if Z <= 0 then raise error 93.900 array('Argument 3 must be greater than zero.') RETURN ('')
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \Y~datatype('N') then raise syntax 93.904 array(2, Y) RETURN ('') -- must be a number
+if \Z~datatype('N') then raise syntax 93.904 array(3, Z) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(4, P) RETURN ('') -- must be a whole number
+if X <= 0 then raise syntax 93.900 array('Argument 1 must be greater than zero.') RETURN ('')
+if Y <= 0 then raise syntax 93.900 array('Argument 2 must be greater than zero.') RETURN ('')
+if Z <= 0 then raise syntax 93.900 array('Argument 3 must be greater than zero.') RETURN ('')
numeric digits P
S = (X + Y + Z) / 2
return self~SQRT(S * (S - X) * (S - Y) * (S - Z), P)
@@ -324,8 +324,8 @@
/*----------------------------------------------------------------------------*/
::method exp class
use strict arg X, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
numeric digits P
Y = X % 1
if ABS(X - Y) > 0.5 then Y = Y + SIGN(X)
@@ -346,7 +346,7 @@
/*----------------------------------------------------------------------------*/
::method floor class
use strict arg F
-if \F~datatype('N') then raise error 93.904 array(1, F) RETURN ('') -- must be a number
+if \F~datatype('N') then raise syntax 93.904 array(1, F) RETURN ('') -- must be a number
return TRUNC(F) - (F < 0) * (F <> TRUNC(F))

@@ -355,7 +355,7 @@
/*----------------------------------------------------------------------------*/
::method ceiling class
use strict arg C
-if \C~datatype('N') then raise error 93.904 array(1, C) RETURN ('') -- must be a number
+if \C~datatype('N') then raise syntax 93.904 array(1, C) RETURN ('') -- must be a number
return TRUNC(C) + (C > 0) * (C <> TRUNC(C))

@@ -364,8 +364,8 @@
/*----------------------------------------------------------------------------*/
::method mod class
use strict arg X, Y
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \Y~datatype('N') then raise error 93.904 array(2, Y) RETURN ('') -- must be a number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \Y~datatype('N') then raise syntax 93.904 array(2, Y) RETURN ('') -- must be a number
if Y = 0 then return X
return X - Y * self~FLOOR(X/Y)

@@ -375,8 +375,8 @@
/*----------------------------------------------------------------------------*/
::method ln class
use strict arg X, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
numeric digits P
if X < 1 then return - self~LN(1 / X, P)
do M = 0 until (2 ** M) > X
@@ -435,8 +435,8 @@
/*----------------------------------------------------------------------------*/
::method sin class
use strict arg X, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
numeric digits P
Pi = self~PICONST()
Signum = 1
@@ -469,8 +469,8 @@
/*----------------------------------------------------------------------------*/
::method cos class
use strict arg X, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
numeric digits P
Pi = self~PICONST()
Signum = 1
@@ -503,9 +503,9 @@
/*----------------------------------------------------------------------------*/
::method sqrt class
use strict arg N, P = 9
-if \N~datatype('N') then raise error 93.904 array(1, N) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(2, P) RETURN ('') -- must be a whole number
-if N < 0 then raise error 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
+if \N~datatype('N') then raise syntax 93.904 array(1, N) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(2, P) RETURN ('') -- must be a whole number
+if N < 0 then raise syntax 93.906 array(1, N) RETURN ('') -- must be zero or a positive whole number
numeric digits P
parse value FORMAT(N,,,,0) with N "E" Exp
if Exp = "" then Exp = 0
@@ -530,11 +530,11 @@
/*----------------------------------------------------------------------------*/
::method power class
use strict arg X, Z, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \Z~datatype('N') then raise error 93.904 array(2, Z) RETURN ('') -- must be a number
-if \P~datatype('W') then raise error 93.905 array(3, P) RETURN ('') -- must be a whole number
-numeric digits P
-if Z < 0 then raise error 88.906 array(1, Z) RETURN ('')
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \Z~datatype('N') then raise syntax 93.904 array(2, Z) RETURN ('') -- must be a number
+if \P~datatype('W') then raise syntax 93.905 array(3, P) RETURN ('') -- must be a whole number
+numeric digits P
+if Z < 0 then raise syntax 88.906 array(1, Z) RETURN ('')
Pwr = 1
do forever
if Z // 2 then Pwr = Pwr * X
@@ -549,9 +549,9 @@
/*----------------------------------------------------------------------------*/
::method repower class
use strict arg X, Z, P = 9
-if \X~datatype('N') then raise error 93.904 array(1, X) RETURN ('') -- must be a number
-if \Z~datatype('W') then raise error 93.905 array(2, Z) RETURN ('') -- must be a whole number
-if \P~datatype('W') then raise error 93.905 array(3, P) RETURN ('') -- must be a whole number
+if \X~datatype('N') then raise syntax 93.904 array(1, X) RETURN ('') -- must be a number
+if \Z~datatype('W') then raise syntax 93.905 array(2, Z) RETURN ('') -- must be a whole number
+if \P~datatype('W') then raise syntax 93.905 array(3, P) RETURN ('') -- must be a whole number
P = P + 4
numeric digits P
if DATATYPE(Z, "W")
```