Post Reply 
The new dfc and dfc2f functions in action
07-10-2018, 08:30 AM (This post was last modified: 07-10-2018 10:49 AM by Didier Lachieze.)
Post: #8
RE: The new dfc and dfc2f functions in action
Adding Joe's suggestions to Dale's program, and with some simplification I've come up with:

Code:
#cas
edfc(nbr1,nbr2):=
begin  
  LOCAL M0,M1,M2,L1;

  M0:=append(dfc(exact(nbr1)),MAXREAL);
  M1:=append(dfc(exact(nbr2)),MAXREAL);
  M2:=sign(abs(M1-M0));  
  L1:=sub(min(M0,M1)+M2,1,POS(M2,1)); 
   
  return dfc2f(L1);
end;
#end

I've declared M0, M1, M2 & L1 as local variables because I don't like to have user functions modifying global variables, but if you want to use the global variables, just remove them from the LOCAL declaration.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: The new dfc and dfc2f functions in action - Didier Lachieze - 07-10-2018 08:30 AM



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