Post Reply 
help: divide a list into other two
05-19-2015, 09:23 PM
Post: #1
help: divide a list into other two
hi,
to calculate MIRR (modified IRR) I need to divide list L1 in this way:
if L1(j) < 0 -> flneg(j), if L1(j) >=0 -> flpos(j)

with
Code:

FOR j FROM 1 TO size(L1) DO
IF L1(j) < 0 THEN flneg(j):= L1(j); ELSE flpos(j):= L1(j); END;
END;

in both lists there is 0 at the correspondent place in the other list (i.e. {-1, 2, 3, -4} -> {-1, 0, 0, -4} and {0, 2, 3, 0}
I need {-1, -4} and {2, 3}

please, help
TIA!

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
help: divide a list into other two - salvomic - 05-19-2015 09:23 PM



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