home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lifeos2.zip
/
LIFE-1.02
/
TESTS
/
LF
/
NUMERIC.LF
< prev
next >
Wrap
Text File
|
1996-06-04
|
583b
|
26 lines
% FILE. . . . . /_/hassan/_/life/numeric
% EDIT BY . . . Hassan Ait-Kaci
% ON MACHINE. . Prl316
% STARTED ON. . Sun Jun 9 16:27:24 1991
% Last modified on Wed Feb 19 16:15:24 MET 1992 by mezhoud
% modified on Sun Jun 09 16:27:29 1991 by Hassan
% remainder (or modulo) function:
rem(N,P)-> N-P*floor(N/P).
nat -> {0;1+nat}.
aroot(X)-> cond(X<0,
eval_pred(write('*** Negative argument in ''aroot''.')),
cond(X=:=0,
0,
aroot_approx(X,1))).
aroot_approx(X,R)-> cond(abs(Y*Y/X-1)<0.00000001,
Y:((X-R*R)/2/R+R),
aroot_approx(X,Y)).