Re: Here's one for you rick
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Thu, 19 Apr 2007 11:19:30 -0700
Rick Rothstein (MVP - VB) <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote:
(Maximum Of A and B) = (A + B + Abs(A - B)) / 2
(Minimum Of A and B) = (A + B - Abs(A - B)) / 2
Neat tricks. Puzzling out the math (average of the two plus or minus
half
the difference), it makes perfect sense, but I'd never thought of that
before, nor have I ever come across it anywhere until now. Very neat!
Cool trick, alright. But couldn't ever dream of being more efficent than
a standard comparison.
I agree... and sort of said so in a response Michael telling him not to use
the one-liner that is built around it.
Yeah, I noted that.
The only reason I used it was because Michael "challenged" me
Certainly reason enough! <g>
I actually liked my Format statement trick better (where I use the \0 to
force negative values to zero).
That was very cool too. I don't know if I've ever used that outside Excel, myself!
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- References:
- Here's one for you rick
- From: Michael C
- Re: Here's one for you rick
- From: Rick Rothstein \(MVP - VB\)
- Re: Here's one for you rick
- From: Michael C
- Re: Here's one for you rick
- From: Rick Rothstein \(MVP - VB\)
- Re: Here's one for you rick
- From: Robert Morley
- Re: Here's one for you rick
- From: Karl E. Peterson
- Re: Here's one for you rick
- From: Rick Rothstein \(MVP - VB\)
- Here's one for you rick
- Prev by Date: Re: and then came MOD
- Next by Date: Re: and then came MOD
- Previous by thread: Re: Here's one for you rick
- Next by thread: Re: Here's one for you rick
- Index(es):
Relevant Pages
|