Re: How to find the greatest of two numbers without using the comparison operators?
- From: "Michael Mattias" <mmattias@xxxxxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 13:09:34 GMT
"Aparajita" <aparajita.mohanty@xxxxxxxxx> wrote in message
news:1188561799.566239.84930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
or your response.Hi,
I want to find the greatest of two given numbers say 'A' and 'B.
I got an alternate solution,
like this
IF A-B IS POSITIVE
DISPLAY "A IS GREATER"
ELSE
DISPLAY "B IS GREATER"
END-IF.
What is your opinion on the above solution? Or if you find any
limitations or constraints with this code, please let me know.
I use three (3) tests for code:
1. Works correctly?
2. Relatively efficient?
3. Maintainable?
If 'yes' to all, it's a keeper.
MCM
.
- Follow-Ups:
- 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 the comparison operators?
- Index(es):
Relevant Pages
|