For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2007 > Re: How to find the greatest of two numbers without using thecomparison operators?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to find the greatest of two numbers without using thecomparison operators?
Pete Dashwood

2007-08-31, 6:58 pm



"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:46D7E17F.6F0F.0085.0@efirstbank.com...
> <1188542463.524263.317700@i38g2000prf.googlegroups.com>,
> Aparajita<aparajita.mohanty@gmail.com> wrote:
>
> Not sure why you need this, but perhaps FUNCTION MAX could give you what
> you
> want?
>
> COMPUTE MAX = FUNCTION MAX(A B)
>
> Well, I guess there's no IF in that.
>
> I guess the POSITIVE usage others have given is the answer.
>


No, the SIGN test is the answer. (POSITIVE is only one aspect of it...)

Pete.
--
"I used to write COBOL...now I can do anything."


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com