Re: abs function
- Posted by Greg Harris <blackdog at CDC.NET> Sep 01, 1998
- 574 views
Oops Jiri.. you beat me to it.. :) Greg Harris HHS -----Original Message----- From: jiri babor <jbabor at PARADISE.NET.NZ> To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU> Date: Tuesday, September 01, 1998 9:57 AM Subject: Re: abs function >Alan Tu wrote: > > >>A cleaner abs function. >> >>function absolutevalue(atom i) -- doesn't need to be an integer! >> atom r >> r = i >> if i<0 then >> r = -1 * i >> end if >> return r >>end function > > > >Alan, if you want to be serious about cleaning, get rid of the cobwebs: > >function absolutevalue(atom i) > if i<0 then > return -i > end if > return i >end function > >jiri >