Post Reply 
Trouble with this programm. Please help!
03-16-2015, 04:09 PM (This post was last modified: 03-16-2015 04:17 PM by Marcio.)
Post: #5
RE: Trouble with this programm. Please help!
I would just replace SIZE with lenght as it will work with both lists and vectors.

Code:

EXPORT PARAL(L1)
BEGIN
LOCAL T;
LOCAL I;
LOCAL N;
T:=0;
I:=0;
N:=length(L1);

FOR I FROM 1 TO N DO
T:=T+1/L1(I);
END;

T:=1/T;
RETURN (T);
END;

Example:

Both PARAL([1 2 3]) and PARAL({1,2,3}) will return 6/11, which is equivalent to 0.545454....
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Trouble with this programm. Please help! - Marcio - 03-16-2015 04:09 PM



User(s) browsing this thread: 1 Guest(s)