Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!bionet!agate!ucbvax!ucdavis!caldwr!rfinch From: rfinch@caldwr.water.ca.gov (Ralph Finch) Newsgroups: comp.lang.fortran Subject: MAX function, but carry sign Message-ID: <282@venice.water.ca.gov> Date: 11 Apr 91 15:14:25 GMT Organization: Calif. Depart. of Water Resources, Sac. Lines: 13 I wish to use the max function on absolute values, but carry the sign of the original values. That is: a=max(abs(a1),abs(a2)) ! but a has sign of either a1 or a2 I'm doing this with an IF statement now but wonder if there isn't some combination of max and sign that will give the same result without an IF statement. -- Ralph Finch 916-445-0088 rfinch@water.ca.gov ...ucbvax!ucdavis!caldwr!rfinch Any opinions expressed are my own; they do not represent the DWR