Re: How to find the greatest of two numbers without using thecomparison operators?
- From: "Rick Smith" <ricksmith@xxxxxxx>
- Date: Fri, 31 Aug 2007 12:32:37 -0400
"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
news:46D7E17F.6F0F.0085.0@xxxxxxxxxxxxxxxxx
[snip]
Not sure why you need this, but perhaps FUNCTION MAX could give you whatyou
want?
COMPUTE MAX = FUNCTION MAX(A B)
Another intereting approach might be:
-----
evaluate
function ord-max(A B) - function ord-min(A B)
when 1
display "A is less than B"
when 0
display "A is equal to B"
when -1
display "A is greater than B"
end-evaluate
-----
A and B may be either numeric or alphanumeric, as long as
they are the same.
.
- Follow-Ups:
- Re: How to find the greatest of two numbers without using thecomparison operators?
- From: William M. Klein
- Re: How to find the greatest of two numbers without using thecomparison operators?
- References:
- Prev by Date: Re: How to find the greatest of two numbers without using the comparison operators?
- Next by Date: Re: How to find the greatest of two numbers without using the comparison operators?
- Previous by thread: Re: How to find the greatest of two numbers without using the comparison operators?
- Next by thread: Re: How to find the greatest of two numbers without using thecomparison operators?
- Index(es):
Relevant Pages
|